Protect Next.js API Routes?
Hi,
I have succesfully implemented Kinde to protect my Next.js application. Works nice. I have decided to go with Next.js for the backend API and database fetching as well and by default they're also protected by the standard Kinde configuration with <KindeProvider>. Problem is, I need to be able to call the api routes from other clients as well and for simplicity Postman but I can't seem to just do a request with a access token (generated in Kinde portal). The application want to redirect me to the login route when doing HTTP requests from Postman.
Is it possible to protect pages and api routes but in a way where I am allowed to call the api routes with authentication by Kinde?
I have succesfully implemented Kinde to protect my Next.js application. Works nice. I have decided to go with Next.js for the backend API and database fetching as well and by default they're also protected by the standard Kinde configuration with <KindeProvider>. Problem is, I need to be able to call the api routes from other clients as well and for simplicity Postman but I can't seem to just do a request with a access token (generated in Kinde portal). The application want to redirect me to the login route when doing HTTP requests from Postman.
Is it possible to protect pages and api routes but in a way where I am allowed to call the api routes with authentication by Kinde?