ueberauth / guardian

Elixir Authentication
MIT License
3.43k stars 382 forks source link

Permissions when empty list #630

Closed Lazarus404 closed 4 years ago

Lazarus404 commented 4 years ago

Hey guys,

If I add permissions to claims, but the permissions is an empty list, I get an error. For instance:

MyApp.Guardian.Plug.sign_in(user, %{pem: %{default: []}})

This will produce the error:

protocol Enumerable not implemented for 0 of type Integer. This protocol is implemented for the
following type(s): Ecto.Adapters.SQL.Stream, Postgrex.Stream, DBConnection.Stream,
DBConnection.PrepareStream, Timex.Interval, List, Function, GenEvent.Stream, Range,
File.Stream, Stream, MapSet, HashSet, Date.Range, IO.Stream, HashDict, Map

The problem here is that I can't send anything for permissions except something known from my permissions list. This means, I can't have a logged in user without permissions, which is a thing for new users in my app.

Thanks, Jahred

Hanspagh commented 4 years ago

I think this issue was fixed by this PR #625, but we missing a release

Lazarus404 commented 4 years ago

Thanks. I'll try the master branch and will respond if I spot anything :)

Lazarus404 commented 4 years ago

This is indeed fixed in master :)