-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
Page role authentication does not work when using roles
instead of role
#4256
Comments
thanks for the issue @mjyoung! It would be better to handle this case. Marking it as ready to work on. |
Any update or ETA on this? :) |
@siddhsuresh just another gentle ping on this. is this planned to be fixed in the near future? |
@mjyoung Hello ! If needed I can work on it :) |
that's great @cmoileo! It would be good to handle this. Let me know if I can help in any way.
not planned per se, but I am ready to review the code for the fix if done by the community, |
@siddhsuresh Alright, I will work on it this week-end. I'll come to you if needed :) |
@siddhsuresh I've sent the PR -> #4275 |
What is the problem?
When creating a session and setting
publicData.roles = ["Role1", "Role2"]
, usingPage.authenticate = { role: "Role1" }
does not work and will always result in anAuthenticationError
.It looks like this assumes we're always setting a single
publicData.role
instead of an array of roles:blitz/packages/blitz-auth/src/client/index.tsx
Line 352 in fb232d1
Paste all your error logs here:
Paste all relevant code snippets here:
mutations/login.tsx
pages/protected.tsx
What are detailed steps to reproduce this?
pages/protected.tsx
:/protected
Will always get an error because the auth client only checks against the
publicData.role
instead ofpublicData.roles
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: