Next.js Discord

Discord Forum

How to make refresh token temporarily available to frontend?

Unanswered
Bigeye scad posted this in #help-forum
Open in Discord
Bigeye scadOP
I have a browser extension that I want to sync auth with so as to not make the user log in twice. I want to pass the refresh token to the extension so it can store it and be used separately from the web app.
Right now I set a short-lived cookie with the refresh token after authenticating that the frontend reads and deletes. Is there a saner way?

I'm using OIDC (AWS Cognito)

Also I would like the frontend to have the ID token as well.

I can't just put these in the session because it gets bigger than 8k (encrypting a JWT - not great for size) and everything breaks horribly because my headers are too big.

0 Replies