I'm using nextJS and I'm having a hard time getting the full URL from a redirect.
I'm doing an oauth flow from Twitch and after authenticating, Twitch redirects back to my Next app on a URL like http://localhost:3000/auth/twitch/
- they include a bunch of extra data on that redirect url e.g.
http://localhost:3000/auth/twitch/callback#access_token=4kfdiopdsjendc539c9234&scope=user_read&token_type=bearer
/pages/auth/callback.js
export async function getServerSideProps(context) {
console.log(context);
return {
props: {},
};
}
I'm trying to get the queryparams (e.g. access_token) from the redirect has but since Twitch append it onto my redirect url with a #, nothing inside of context
seems to detect it.
I know if I manually change the #
in the browser to a ?
then context.query
works. Problem is, I can't dictate how Twitch attack their data to the URL.
How can I access the query params?