n1ru4l
08/04/2023, 8:09 AMsupertokens-auth-react
SDK? The route will return 200
for everything. I am looking for a getRoutingComponent
equivalent e.g. getStatusCodeForRoute
that I can call within getServerSideProps
.rp_st
08/04/2023, 8:20 AMn1ru4l
08/04/2023, 8:21 AM/auth/kwjhdweljhklwhjrdiwehrflwekhrkwer
I get status code 200n1ru4l
08/04/2023, 8:21 AMrp_st
08/04/2023, 8:21 AMn1ru4l
08/04/2023, 8:22 AMrp_st
08/04/2023, 8:23 AMrp_st
08/04/2023, 8:24 AMcanHandeRoute
see here: https://github.com/supertokens/next.js/blob/canary/examples/with-supertokens/pages/auth/%5B%5B...path%5D%5D.tsx#L14
Is this what will solve your issue?n1ru4l
08/04/2023, 8:25 AMn1ru4l
08/04/2023, 8:25 AMn1ru4l
08/04/2023, 8:25 AMrp_st
08/04/2023, 8:26 AMn1ru4l
08/04/2023, 8:29 AMn1ru4l
08/04/2023, 8:29 AMrp_st
08/04/2023, 8:30 AMn1ru4l
08/04/2023, 8:51 AMimport { env } from '@/env/backend';
const supertokenRoutes = new Set([
'/auth/verify-email',
'/auth/reset-password',
'/auth/login',
'/auth',
]);
if (env.auth.github) {
supertokenRoutes.add('/auth/callback/github');
}
if (env.auth.google) {
supertokenRoutes.add('/auth/callback/google');
}
if (env.auth.okta) {
supertokenRoutes.add('/auth/callback/okta');
}
if (env.auth.github) {
supertokenRoutes.add('/auth/callback/github');
}
if (env.auth.organizationOIDC) {
supertokenRoutes.add('/auth/oidc');
}
export function canHandleRouteServerSide(path: string) {
return supertokenRoutes.has(path);
}
I came up with something custom based on our configuration 🙂rp_st
08/04/2023, 8:52 AMn1ru4l
08/04/2023, 9:12 AM