Cannot get params from url

@space ❄ (tagging u cous this is followup of my previous question which i closed and cant open anymore) so this is my code:
const params = new URL(req.url).searchParams
const [accessToken, tokenType] = [params.get('access_token'), params.get('token_type')];
console.log(accessToken, tokenType)
const params = new URL(req.url).searchParams
const [accessToken, tokenType] = [params.get('access_token'), params.get('token_type')];
console.log(accessToken, tokenType)
but this just logs null null this is the oauth2 url from discord https://discord.com/oauth2/authorize?client_id=1116352238667960392&response_type=token&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fauth&scope=identify
4 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Kay
KayOP12mo ago
this is the url i get redirected to
No description
space
space12mo ago
You may want to read the next few paragraphs of the page, it explains why it doesn't work and how you can make it work.
Kay
KayOP12mo ago
it dosnt say anything abb that. it just explains how to use it when using token type 'code' i also could just be blind tho nvm sorry im just blind
Want results from more Discord servers?
Add your server