ueberauth / guardian

Elixir Authentication
MIT License
3.43k stars 379 forks source link

Permit atom keys when verifying claims with EnsureAuthenticated #696

Closed giddie closed 2 years ago

yordis commented 2 years ago

Hey peep, do you mind sharing what is the use case for the feature? Not sure what the limitations were before. Was it functional or astetic?

giddie commented 2 years ago

Sure, it's pretty simple really:

# This halts the conn, even when claims match `%{"custom_claim" => true}`
plug Guardian.Plug.EnsureAuthenticated, claims: %{custom_claim: true}

# This works as expected
plug Guardian.Plug.EnsureAuthenticated, claims: %{"custom_claim" => true}

Since other functions, such as decode_and_verify handle atom keys OK when verifying claims, I was a bit confused by this behaviour.

yordis commented 2 years ago

Do you mind adding an entry in the CHANGELOG.md and bumping the version accordingly?

yordis commented 2 years ago

🚀