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

isAdmin and isAuthRecord return false #323

Closed
chnfyi opened this issue Nov 29, 2024 · 2 comments
Closed

isAdmin and isAuthRecord return false #323

chnfyi opened this issue Nov 29, 2024 · 2 comments

Comments

@chnfyi
Copy link
Contributor

chnfyi commented Nov 29, 2024

Hi,

Both pb.authStore.isAdmin and pb.authStore.isAuthRecord return false. It seems that getTokenPayload(token).type value refers now to the token type ("auth", etc.) while still being compared to a record type string ("admin" or "authRecord").

Because the default users collection id is pb_users_auth, i explored the possibility to use getTokenPayload(token).collectionId instead with something like includes() method but newly created auth collections have the same id format (pbc_0123456789) as the _superusers collection.

Note: isAdmin may should be isSuperuser for consistency.

@ganigeorgiev
Copy link
Member

Oh, it seems that I've forgotten to update them. I'll push a fix in the JS SDK a little bit later.

@ganigeorgiev
Copy link
Member

I've pushed a "fix" in v0.22.1.

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