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
Guardian.Plug.sign_in is not injecting permissions #47
Comments
Hi @Pjino. What version are you currently using? Can I see your config for guardian? |
Hi @hassox. I'm using the latest version of everything (Guardian, Phoenix,...) and I (think) I made all the necessary changes. |
Thanks. Just an FYI you have two hooks declared. The reason you're seeing the -1 is because you're setting the default permissions to Guardian.Permissions.max in sign in. If you had this instead do you still see -1?
|
I think I'm seeing the same issue. |
@yuyabee Yes, |
@Pjino Sorry, that was a typo, it's |
@yuyabee Yes, it returns []. Sorry for testing it in such a rush that I didn't even try to see why it returned undefined...It was obvious:) |
I haven't been able to repeat this locally :( I'm guessing that you're running Guardian 0.6.1 which was a bit buggy. GuardianDb was requiring this version. I've updated GuardianDb to rely on 0.6.2 in v 0.1.2. Can you please update guardian db and guardian and see if you still have the same issue? |
@hassox Yes that was it. Upgrading to 0.6.2 solved it. Thank you so much. |
Phew! Thanks so much for looking into it :) |
I'm using and updated version of the Guardian example it seems that whatever combination of permissions I try to inject (for instance, "Guardian.Plug.sign_in(user, :token, perms: %{ default: :write_profile })" it won work.
When inspecting claims I always see: ..."pem" => %{"default" => -1},
The text was updated successfully, but these errors were encountered: