You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This made sense at the time we wrote it because the :decoded key is the decoded JWT. 💭
But in the context of an App usingauth_plug I find myself writing conn.assigns.decoded.id a lot when I think it would be more intuitive to write conn.assigns.person.id ...
Given that nobody else is using auth_plug yet, now is the time to make this change.
I think it will make things a lot clearer for people in the future.
Todo
Rework create_session/3 to assign the decoded claims to conn.assigns.person
Going to get this done now as it's the penultimate thing on my list before assigning auth/pull/43
I expect it to take around T25m but I've estimated T1h for tidying up tests and docs. ⏳
At present we are assigning the verified and decode JWT to
conn.assigns.decoded
:auth_plug/lib/auth_plug.ex
Line 100 in 3bcdac1
This made sense at the time we wrote it because the
:decoded
key is the decoded JWT. 💭But in the context of an App using
auth_plug
I find myself writingconn.assigns.decoded.id
a lot when I think it would be more intuitive to writeconn.assigns.person.id
...Given that nobody
else
is usingauth_plug
yet, now is the time to make this change.I think it will make things a lot clearer for people in the future.
Todo
create_session/3
to assign the decodedclaims
toconn.assigns.person
auth_plug/lib/auth_plug.ex
Lines 97 to 103 in 3bcdac1
conn.assigns.jwt
i.e.assign(:jwt, jwt)
instead ofassign(:person, jwt)
jwt
instead of person i.e.put_session(:jwt, jwt)
cond
block to look for thejwt
by the:jwt
key instead of:person
:auth_plug/lib/auth_plug.ex
Lines 33 to 59 in 3bcdac1
1.1.0
is fine)The text was updated successfully, but these errors were encountered: