https://supertokens.com/ logo
j

Jota

06/06/2022, 10:24 AM
I added the discord provider but get the next error Error: Request failed with status code 401
r

rp

06/06/2022, 10:42 AM
hey @Jota
are you getting a field error with this?
Also, what does your discord config look like?
j

Jota

06/06/2022, 3:15 PM
One the frontend `` providers: [ { id: "discord", name: "Discord", buttonComponent: <div style={{ cursor: "pointer", border: "1", paddingTop: "5px", paddingBottom: "5px", borderRadius: "5px", borderStyle: "solid" }}>Login with Discord } ],``
r

rp

06/06/2022, 3:16 PM
and the backend?
j

Jota

06/06/2022, 3:17 PM
On the backend `` Discord({ clientId: process.env.DISCORD_OAUTH_CLIENT_ID, clientSecret: process.env.DISCORD_OAUTH_CLIENT_ID, scope: [ 'identify', 'guilds' ] }) ``
The error is this Error: Request failed with status code 401 at createError (C:\Users\joao_\OneDrive\Área de Trabalho\Projetos\aggregator-backend\node_modules\supertokens-node\node_modules\axios\lib\core\createError.js:16:15) at settle (C:\Users\joao_\OneDrive\Área de Trabalho\Projetos\aggregator-backend\node_modules\supertokens-node\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (C:\Users\joao_\OneDrive\Área de Trabalho\Projetos\aggregator-backend\node_modules\supertokens-node\node_modules\axios\lib\adapters\http.js:269:11) at IncomingMessage.emit (node:events:538:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)
r

rp

06/06/2022, 3:20 PM
You need to add scope "email"
and try again
j

Jota

06/06/2022, 3:23 PM
Still same error
got it
process env was incorrect
r

rp

06/06/2022, 3:23 PM
👍
j

Jota

06/06/2022, 3:24 PM
Thank you
I will always need to click on authorize to login?
r

rp

06/06/2022, 3:25 PM
You shouldnt have to. Only when scopes change
j

Jota

06/06/2022, 3:26 PM
it always ask me
r

rp

06/06/2022, 3:43 PM
That’s strange. Can you open an issue about this on our GitHub?
We will come around to seeing this tomorrow or day after
2 Views