How to implement JWT authentication with Next.js 14 App Router and external API? #87276
Unanswered
codiebyheaart
asked this question in
Help
Replies: 1 comment
-
|
Reading your description, I'd say, well, JWT into the cookies is what you have designed for. Do you need to read data from the JWT on the client? I'd say regardless go with httpOnly, if you need to read, do so through a route handler
You'd need to set the revalidated token into the request going upstream, and the response going downstream. Make sure it is fast though, otherwise you'd delay rendering. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm building a Next.js 14 application that needs to authenticate users against an external Spring Boot API. I'm struggling with:
I've tried using middleware but facing issues with token refresh logic.
Additional information
Example
I can provide a minimal reproduction if needed. Currently testing locally.
Beta Was this translation helpful? Give feedback.
All reactions