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

extractUserData only works with usernames #723

Open
spaceemotion opened this issue Apr 29, 2024 · 3 comments
Open

extractUserData only works with usernames #723

spaceemotion opened this issue Apr 29, 2024 · 3 comments

Comments

@spaceemotion
Copy link

My app uses JWT to authenticate users, which only contain a user ID, and not a user name.

The current requirement for getting extractUserData to work (based on the types at least) is to always provide a username though:

username: string,

Is there a way to make them all optional? Not all my requests have an authenticated user (some are public routes) so being able to return 'nothing' would also come in quite handy.

@dnlup
Copy link
Contributor

dnlup commented May 3, 2024

Hi @spaceemotion , thank you for reporting this. username should definitely be optional, that's how it's handled too (

if (key in user) {
). would you like to open a PR to fix that type?

@spaceemotion
Copy link
Author

@dnlup would that make all keys optional then? some people might only have the ID, some only the username...

@dnlup
Copy link
Contributor

dnlup commented May 3, 2024

@dnlup would that make all keys optional then? some people might only have the ID, some only the username...

@spaceemotion Yes, all the keys should be optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants