Hi, I have update Supertokens core to 5.0 and updated supertokens-node to 14.1.1 (latest) but when I...
a
Hi, I have update Supertokens core to 5.0 and updated supertokens-node to 14.1.1 (latest) but when I try to login it says SOMETHING_WENT_WRONG_ERROR with error 500 Node express backend log:
Copy code
data: { error: 'invalid_grant', error_description: 'Bad Request' }
POST /auth/signinup 500
should I update any of my node codes after updating to core 5.0?
r
hey @amirnoorani this usually happens if there is a misconfig in the redirect uri. It can also happen if this API is being called twice - are you using custom UI in react?
a
Before updating to core 5 everything worked fine. No I'm using nextjs with PrebuiltUI. I'll check the redirect url and let you know
r
this error has nothing to do with the core.
are you using our pre built UI?
and are there two POSTs requests going to
/auth/signinup
?
(please share a screenshot of the network tab on chrome)
a
Yes I'm using prebuilt UI

https://cdn.discordapp.com/attachments/1111781572685860955/1111941414507520031/image.png

https://cdn.discordapp.com/attachments/1111781572685860955/1111941414918553660/image.png

r
i mean the network tab - so all the network requests on chrome
a

https://cdn.discordapp.com/attachments/1111781572685860955/1111943566957215854/image.png

Copy code
Request URL:
https://dl.dizzland.com/auth/signin
Request Method:
POST
Status Code:
500 Internal Server Error
Remote Address:
185.141.107.191:443
Referrer Policy:
strict-origin-when-cross-origin
Access-Control-Allow-Credentials:
true
Access-Control-Allow-Origin:
https://www.dizzland.com
Access-Control-Expose-Headers:
Content-Disposition
Connection:
keep-alive
Content-Length:
144
Content-Type:
text/html; charset=utf-8
Date:
Sat, 27 May 2023 09:15:59 GMT
Etag:
W/"90-YO9NUeRxS59V3MBQMHe6TVyAfpA"
Server:
nginx/1.18.0 (Ubuntu)
Vary:
Origin
X-Powered-By:
Express
Accept:
*/*
Accept-Encoding:
gzip, deflate, br
Accept-Language:
en-US,en;q=0.9,fa-IR;q=0.8,fa;q=0.7
Connection:
keep-alive
Content-Length:
104
Content-Type:
application/json
Cookie:
sAccessToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0%3D.eyJzZXNzaW9uSGFuZGxlIjoiMjRhN2M2M2YtYzOP9oJ7FRuez0dHV2xj8xAuHqhVwm1%2BIziz3GVuWdbRqn2fWWHj47rknOPNp7dA94MmXAI9cLtLtYoKCJVZH%2FUdLcSjL%2FITh%2Fpy5EPA3qTtRBrhaGj8fQNf2T05m9MU8dP7YZAN0E5C577kSV51jMRoVlht5Lx9GFvUMt8z8TRNK8Jby4WUViMWvdlDStB3y%2Bg%3D%3D; _ga_S31STK5HWY=GS1.1.1685177959.46.1.1685178914.0.0.0
Fdi-Version:
1.16
Host:
dl.dizzland.com
Origin:
https://www.dizzland.com
Referer:
https://www.dizzland.com/
Rid:
thirdpartyemailpassword
Sec-Ch-Ua:
"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
Sec-Ch-Ua-Mobile:
?0
Sec-Ch-Ua-Platform:
"Windows"
Sec-Fetch-Dest:
empty
Sec-Fetch-Mode:
cors
Sec-Fetch-Site:
same-site
St-Auth-Mode:
cookie
User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
r
even the refresh API is giving a 500..
whats the error stack on the backend when the refresh API is called?
a

https://cdn.discordapp.com/attachments/1111781572685860955/1111947395173982238/image.png

r
is the supertokens core running fine?
a
should I run any command to know?
r
visit the /hellp path of the core on your browser
a

https://cdn.discordapp.com/attachments/1111781572685860955/1111948250929446982/image.png

r
right. So im not sure why your backend is giving a 500
can you enable backend debug logs and show the output when refresh API is called?
have you added our supertokens error Handler to your backend?
a
how can I do that?
let me check
app.use(errorHandler());
you mean this?
r
yea
can you enable backend debug logs and show the output when refresh API is called?
a
How can I enable debug logs?
r
see our docs please
a
sure
r
would appreciate it you first see our docs and then ask 🙂
a
sorry. I'll check it
r
it seems like the core is throwing an error.
what happens when the refresh is called on the core side? Can you send me the core logs?
a
I have enabled core debug mode. where can I find the logs?
r
Docker logs
a
without docker
r
If not using docker, then find logs in installation dir of the core
a
OK
r
you have upgraded to the latest core?
you need to run the migration steps. See the core changelog on our github. It has instrs on what migration commands to run for sql
a
I have downloaded the latest linux core in zip file
r
yea, but you are running it against a database that used to work with the older version of the core.
So you need to migrate
a
Sure
Thank you for your help
👍👍
115 Views