Using emailPasswordSignUp function returns 500 Int...
# support-questions
a
Using emailPasswordSignUp function returns 500 Internal server error
Hi @rp & @Adiboi thanks for making such a cool tool! I've built a custom UI on my frontend (NextJS) (for login and signup) and i'm using the most recent versions of both: **supertokens-auth-react**: 0.22.3 **supertokens-node**: 9.2.3 I've also made sure that my frontend config formfields array matches the formfields array in my backend config (at least where the id and optional keys are concerned) I then call the emailPasswordSignUp function passing in the formField array of:
Copy code
[
    {
        "id": "registerAs",
        "value": "Job Seeker"
    },
    {
        "id": "firstname",
        "value": "Inioluwa"
    },
    {
        "id": "lastname",
        "value": "Atoyebi"
    },
    {
        "id": "companyname",
        "value": ""
    },
    {
        "id": "email",
        "value": "iatoyebi.3134@gmail.com"
    },
    {
        "id": "password",
        "value": "7a9Bc6hE$@"
    }
]
But I get this response on the frontend:
Copy code
{
  body: ReadableStream
  bodyUsed: false
  headers: Headers {}
  ok: false
  redirected: false
  status: 500
  statusText: "Internal Server Error"
  type: "basic"
  url: "http://localhost:3000/api/auth/signup"
}
Supertokens core is definitely running because when I go to
http://localhost:3567/hello
I see hello on my browser, and when I go to
http://localhost:3567/apiversion
i see this:
Copy code
{
  "versions": [
    "2.14",
    "2.13",
    "2.12",
    "2.7",
    "2.11",
    "2.8",
    "2.10",
    "2.9"
  ]
}
Strangely enough on my server side I see this error message:
Copy code
Error: SuperTokens core threw an error for a GET request to path: '/apiversion' with status code: 404 and message: <!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills.js?ts=1655289344944"></script><script src="/_next/static/chunks/webpack.js?ts=1655289344944" defer=""></script><script src="/_next/static/chunks/main.js?ts=1655289344944" defer=""></script><script src="/_next/static/chunks/pages/_app.js?ts=1655289344944" defer=""></script><script src="/_next/static/chunks/pages/_error.js?ts=1655289344944" defer=""></script><script src="/_next/static/development/_buildManifest.js?ts=1655289344944" defer=""></script><script src="/_next/static/development/_ssgManifest.js?ts=1655289344944" defer=""></script><script src="/_next/static/development/_middlewareManifest.js?ts=1655289344944" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body><div id="__next"><!--$--><div class="flex flex-col justify-center items-center w-screen h-screen"><img class="animate-bounce" style="width:15rem" src="/assets/logos/scalein-logo.png"/></div><!--/$--></div><script src="/_next/static/chunks/react-refresh.js?ts=1655289344944"></script><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
But I can confirm that the formFields are reaching the
api/auth
endpoint because I printed out the body of the request and it matches what was sent. Any help you can give will be greatly appreciated! Thanks
r
hey! thanks for the detailed message @Atoyebs
What's the connectionURI that you have provided in the backend supertokens.init config?
a
@rp i've been an idiot, I was using an environment variable but mispelt the variable. Its working now! Thanks a bunch!
r
oh awesome! happens to the best of us 🙂
a
Hi @rp is there a way to dynamically assign a role to a session? So what I mean is, if there are two types of users that the user can choose at sign up I want to be able to pass their choice (from the frontend) into the session. Is there any way to do that at the moment?
r
Yes! You can do that using the userContext object
a
thanks for the speedy response, you guys are awesome
15 Views