At the moment in my nextJS API Routes I use session based authentication which works nicely in direct combination with my components and in the browser. But I designed the API in a way that it should also be usable by other clients. Is it possible to reuse these APIs in a way where I use the token provided by getAccessToken(req, res); in the header to authenticate all requests?
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Calling a protected NextJS API route from another Protected NextJS API route | 3 | 641 | July 29, 2024 | |
The API calls using nextjs-auth0 are always showing as unauthenticated | 4 | 1707 | April 8, 2024 | |
How to access my custom protected API, created in Next JS | 4 | 734 | April 18, 2024 | |
How to access Next.js API endpoint with JWT | 2 | 3748 | December 21, 2022 | |
Next.js using getSession or getAccessToken resulting in user authentication being lost | 2 | 334 | February 7, 2025 |