kyomster
01/02/2024, 2:25 PMconst { session, hasToken, hasInvalidClaims } = await getSSRSession();
if (!session) {
if (!hasToken) {
return redirect("/auth");
}
if (hasInvalidClaims) {
return <SessionAuthForNextJS />;
} else {
return <TryRefreshComponent />;
}
}
But it redirect to /auth and therefore after I am back to the / page instead of the page from with I called redirect.
How can I do so that it redirect to the previous page ?
Thanks.rp_st
01/02/2024, 4:23 PM/auth
, you can do /auth?redirectToPath=<PAGE PATH TO REDIRECT BACK TO>
. Note that you have to url encode the value you set to redirectToPath
kyomster
01/03/2024, 2:36 PMrp_st
01/03/2024, 2:37 PMkyomster
01/03/2024, 3:18 PMrp_st
01/03/2024, 3:22 PM