error when setting up emailpassword login in nextjs
w
error when setting up emailpassword login in nextjs
r
hey @wisdomekpotu
@porcellus can help here.
w
ok
r
in the meantime, can you share the version of supertokens-auth-react and supertokens-web-js in your package-json.lock or yarn.lock?
w
supertokens-auth-react
r
and supertokens-web-js also please
w
is it this one
r
which version of npm are you using?
w
8.19.2
r
hmm. and you don't have supertokens-web-js anywhere in the package-lock.json file?
p
hmm, are you using yarn?
w
oh yeah
i didnt install supertokens-web-js
my bad
r
no worries 🙂
w
i am working on an article, i would like to get a review from you
r
once it's published, we will be happy to read and tweet about it - if that's what you are asking
w
okay that would be nice
plz could you explain what windowHandler does here // config/frontendConfig.js import EmailPasswordReact from 'supertokens-auth-react/recipe/emailpassword' import SessionReact from 'supertokens-auth-react/recipe/session' import { appInfo } from './appInfo' import Router from 'next/router' export const frontendConfig = () => { return { appInfo, recipeList: [ EmailPasswordReact.init(), SessionReact.init(), ], // this is so that the SDK uses the next router for navigation windowHandler: (oI) => { return { ...oI, location: { ...oI.location, setHref: (href) => { Router.push(href) }, }, } }, } }
r
It’s used to customise we use functions of the window. So here we are telling supertokens to use the router from NextJS when doing navigation on the frontend
w
does it override supertokens library
r
a part of it, yea
w
alright thanks for the help
hey so i am trying to login and i have gotten my credentials but when i try to login it shows this error
error - Error: No SuperTokens core available to query
@rp_st
r
Can you check that the env var is correctly being injected?
Into your backend code
w
hmm strange i just created a new api key and it worked
r
Hmmmm. That’s weird