u/BrotherManAndrew

▲ 14 r/elixir

Idiomatic way to see if a collection of values are all equal?

In my application I want to check if 3 variables equal to the same value, I mean I could try to chain a bunch of == but that seems very superfluous unnecessary. What is the proper way to see if a collection of values are all equal?

reddit.com
u/BrotherManAndrew — 3 days ago
▲ 4 r/elixir

Confusion about how tokens are stored in sessions

Hi, I was implementing some code for guardian authentication from the tutorial linked here: https://www.youtube.com/watch?v=58o66XhsWj8&list=PL2Rv8vpZJz4zM3Go3X-dda478p-6xrmEl&index=8

and I came across this line of code

plug Guardian.Auth.VerifySession

I understand that it finds the token from the session (which is a place where data from subsequent requests are stored) but how is this token stored in the session in the first place ? Is it when the user registers that the server takes the token and both gives it to the user as well as storing it in the session ? Is it when the user logs in (sending a request) and gives the token to the server which is then placed into the session ? How does the session even work elixir/phoenix wise!?

This is confusing to me, and any help would be appreciated !

u/BrotherManAndrew — 12 days ago