SimonLeclere / discord-easy-dashboard

💻 Simple module to facilitate the creation of dashboard using discord.js and express
https://www.npmjs.com/package/discord-easy-dashboard
71 stars 11 forks source link

redirect uri going back to authorization page #34

Closed EclipseGame18 closed 1 year ago

EclipseGame18 commented 1 year ago

Hey, I recently made some changes to the dashboard, and I changed the bot from an old one to a new one. I changed the token and the secret. now when I log in I got to the correct login page with the correct bot, and when I log in I get sent back to the login page. the code and developer portal redirect URI is: https://tbtda.xyz/auth/login

nothing has really changed from before. discord should send me back to https://tbtda.xyz

SimonLeclere commented 1 year ago

Hey, it seems that your redirectURI is wrong

EclipseGame18 commented 1 year ago

the uri is the same on both code and portal, there is no invalid_uri errors

SimonLeclere commented 1 year ago

Can you show me your discord dev page ? (Not the token and secret just the redirect)

EclipseGame18 commented 1 year ago

image

SimonLeclere commented 1 year ago

That's weird... Does it works in local ?

EclipseGame18 commented 1 year ago

and here is some configuration: baseUrl: process.env.REDIRECT_URI, // Leave this if ur in local development (https://tbtda.xyz) port: process.env.PORT, (heroku port) noPortIncallbackUrl: true, secret: process.env.BOT_SECRET, theme: 'dark', faviconPath: buffer, serverUrl: 'https://discord.gg/3mkKSGw', permissions: ['ManageGuild']

EclipseGame18 commented 1 year ago

That's weird... Does it works in local ?

yes, it does work in local

SimonLeclere commented 1 year ago

Well i don't know 🥲 Maybe try reverting to an older version that used to work ? If you find the answer i'm curious to know !

EclipseGame18 commented 1 year ago

if the secret is different to the token will that change anything?

EclipseGame18 commented 1 year ago

so if the secret belonged to a different bot to the token

SimonLeclere commented 1 year ago

Token and secret are two different strings but they must belong to the same bot

EclipseGame18 commented 1 year ago

I got it working! my secret and token didn't match so it wasn't authenticating correctly. turns out that even if your token and secret don't match discord will still let you authenticate without errors. but I matched the secret and token to the right bot and it worked as expected!

EclipseGame18 commented 1 year ago

i feel so stupid now... the solution was that simple

SimonLeclere commented 1 year ago

Haha at least you got it 😆