Next.js Discord

Discord Forum

Authorization and redirect using “output: export”

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
I have a tauri application with nextjs (app directory). I have a simple nestjs api with a login endopoint that returns the access and refresh tokens; pretty standard. I already have made the login form and handled the refresh token workflow; still, I'm struggling in making the authentication redirecting work. I simply have to check whether the user is authenticated or not and if not redirecting to the login page. With ssr nextjs this would be pretty simple, I simply would have to create a middleware and check the cookie from the server side. How can I handle this with ssg? I have tried already redirecting using a HOC Component but haven't managed to make it work. Any advice would be appreciated.

0 Replies