jwt-auth icon indicating copy to clipboard operation
jwt-auth copied to clipboard

Tokens in Context

Open areYouLazy opened this issue 3 years ago • 1 comments

It would be useful to have AuthToken, RefreshToken, X-Csrf-Token and expiration in the request.Context(). This is useful if you need to send tokens in request body or do something else with tokens

    authTokenString := jwtauth.GetAuthTokenFromContext(r.Context())
    refreshTokenString := jwtauth.GetRefreshTokenFromContext(r.Context())
    csrfTokenString := jwtauth.GetCSRFTokenFromContext(r.Context())

    // do stuffs with tokens

areYouLazy avatar May 14 '21 08:05 areYouLazy

Agreed. I'll look into it.

Thanks

adam-hanna avatar May 14 '21 12:05 adam-hanna