SuperTokens, Open Source Authentication
# support-questions
v
I'm attempting to follow the instructions here: https://supertokens.com/docs/emailpassword/pre-built-ui/setup/frontend I have the front, back, and core implemented, but I'm running into a hurdle adding the routes to my application. The docs indicate I can use
SuperTokens.getRoutingComponent
however, my TS is saying this function doesn't exist.
I'm planning on using https://github.com/tanstack/router as my routing component, so I think I need to get into some of the internals of the supertokens routing.
Currently, I don't see a way to bind routes. The documentation seems out of date.
Seems like I maybe can't use the prebuilt ui
I'm pretty confused on how to use SuperTokens in a react app.
Anyone available to answer some questions?
a
Hey @Vaune_ , the engineering team will get back to you in 6-8 hours from now. Please check back then
r
hey @Vaune_ I think at the time you had seen our docs, it was outdated compared to the new SDK version. Please empty cache and hard reload the docs and the new snippet should work.
Using a different routing component other than the one we have can be tricky. You can see how we have added the nextjs router here for example: https://github.com/supertokens/next.js/blob/canary/examples/with-supertokens/config/frontendConfig.ts#L32 Would this kind of a method work for you?
v
I've tried a bunch of different things, and I can't figure out how to wire this up correctly.
r
Right. I’m not familiar with this router, and it may not be possibly to add it in without a change in the SDK.
But you can use the router for the rest of your app and use full page reload for the auth route. And that would work
v
I've gotten close I think. I have a custom ui that uses supertoken on the backend, I can sign in, reset password, signup, ect.
I'm having trouble figuring out the logic behind routing setup.
r
For custom ui, the routing is something that you control entirely.
So that’s outside the scope of supertokens
v
Can the component still be used to wrap a component for session handling / redirection?
r
It can. But then that wouldn’t use your router.
So you should see the custom ui snippets
And maybe make your own version on SessionAuth that uses your router
v
Hm, ok thank you.