Following this example <https://www.ory.sh/login-s...
# talk-kratos
m
Following this example https://www.ory.sh/login-spa-react-nextjs-authentication-example-api-open-source/ i have implemented login and signup in next js and it works, but if the user has not login but if they type the route address in browser they are still directed to that page, any solution for this.
p
Hi, you need to check that the user is logged in through a route guard or before the component is rendered. Another solution is to add a reverse proxy in front of your application that checks if the user is authenticated (has a session cookie) before forwarding to a route on your app other than login/signup
1
m
any documentation link for route gaurd?
p
m
Thank you!
One last thing https://www.ory.sh/login-spa-react-nextjs-authentication-example-api-open-source/ where does this example store information about users etc, like is there any kind of database and where it is, and what kind of backed is there with this exmple because i did not use kratos docker or cloud
p
this uses the cloud since you most likely exported
Copy code
# If you run Ory Kratos in Ory Cloud:
export ORY_SDK_URL=<https://my-project.projects.oryapis.com>
also from the guide
Copy code
Per default, this app uses the public playground deployment of Ory Kratos at <https://playground.projects.oryapis.com>. To use it, simply run:
m
i did not use this export statement of any kind just cloned the project and it is working
p
per default it exports that and uses
Copy code
<https://playground.projects.oryapis.com>
m
Got it Thank you.