Skip to main content

Sign in

The sign in flow follows the same pattern as the sign up flow but instead of redirecting to the registration page, it redirects to the login page.

app.get("/", (req, res) => {
ory
.toSession({ cookie: req.header("cookie") })
.then((data) => res.json(data))
.catch(() =>
res.redirect(`${process.env.ORY_SDK_URL}/self-service/login/browser`),
)
})

You can alternatively set return_to to a custom URL. This URL will be used as the return URL for the login flow:

https://$ORY_SDK_URL/self-service/login/browser?return_to=https://example.com/dashboard