Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extract username from user should not return undefined #5061

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

nunogois
Copy link
Member

This fixes a return type error by changing the logic of extractUsernameFromUser to never return undefined.

In the previous code, user could be truthy, but that doesn't mean email or username were defined. This assumes we always fallback to "unknown" in those scenarios.

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 8:01am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 8:01am

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/lib/util/extract-user.ts Show resolved Hide resolved
@nunogois nunogois merged commit fd580c9 into main Oct 17, 2023
14 checks passed
@nunogois nunogois deleted the fix-extract-username-from-user branch October 17, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants