Is anyone here who implements supertokens with express backend with custom nextjs UI?
s
Is anyone here who implements supertokens with express backend with custom nextjs UI?
r
hey @shahreaz0
what are your questions about this setup?
s
No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method. nextjs
r
have you intialised the ThirdPartyEmailPassword recipe?
if yes,can i see how (including the import statements)
s
Here is the code
I do everything the docs say
in nextjs with custom UI section
r
whats the import statement of the emailPasswordSignUp function?
s
in a separate file
is it Ok?
r
i need to see the full import statement
the screenshot has cut off
s
@rp_st
Please check the code
I fix it thank you
r
what was the issue?
s
if (typeof window !== "undefined") { SuperTokensWebJs.init(frontendConfig()) }
this code never runs in app/layout.tsx page
r
It should though.
When it’s on the client side
s
I dont know. in my case it never ran
so i have to make a provider for it
r
That’s very strange. You might want to see why that didn’t run, cause it should. On the browser
s
in layout page there is no "use client" prefix . How it is possible it run on client side
r
Do none of your components have a use client?
s
yes i have
r
right ok. The approach you took is correct.
s
how to set token here?
the session.getAccessToken gives undefined
r
You don't need to. As long as you have done session.init, our sdk will take care of it. The sesssion tokens are in cookies and can't be accessed by frontend JS.
s
but how i protect my other microservices?
r
See our guide to micro service auth please
s
ok. With that auth. can I also protect my frontend to? . In my frontend there are 14 services conneted
so I need to project the frontend also 14 other services
r
Frontend should use regular session management
M2m auth is different
s
can access the accesstoken form frontend
anyhow?
I also cant read it from cookies
r
you can acccess it on the frontend.
you have to set a config on the backend
as shown in the link above
s
Thanks man