Closed iamjoshleung closed 1 year ago
refresh_from_cookie
is a boolean, https://github.com/ueberauth/guardian/blob/eafa1e430c9c75b0768a9fd72b18021187d2e15b/lib/guardian/plug/verify_header.ex#L39
plug Guardian.Plug.VerifySession, refresh_from_cookie: true, key: "jwt"
plug Guardian.Plug.VerifyHeader, refresh_from_cookie: true, key: "jwt"
I will suggest asking for help in the Slack channel or using the Discussion
Steps to Reproduce
If I set the cookie key to
guardian_default_token
and use[key: "default"]
then it works. But if I set it toguardian_jwt_token
and use[key: "jwt"]
then it fails. And honestly the whole key thing is very confusing. Why should I need to knowguardian_jwt_token
is the default key by reading the code? It's never mentioned in the docs. It only mentionsThe location of the token (default :default)
Second thing is, I need to set[key: "jwt"]
instead of[key: "guardian_jwt_token"]
? That means I need to know the inner working of the codebase in order to use this functionality. On the hexdocs,:key
is described asThe location of the token
. Doesn't "The key of the token stored in cookies" or something like that seem more intuitive? I honestly didn't understand whatThe location of the token
meant at the first glance becauseThe location of the token
iscookies
when it actually meansThe key of the token
.Expected Result
Successful authentication
Actual Result
:unauthenticated