Hi,
So i have a controller file with the code below :
@Controller()
export class AuthController {
@Get('/oauth-redirect')
discordLoginCallback(@Req() req, @Res() res)
{
client.exchangeOAuthCodeForAccessToken(req.query.code,
clientId,
clientSecret,
'http://localhost:3000/oauth-redirect')
.then((response) => {
return client.retrieveUserUsingJWT(response.response.access_token);
})
.then((response) => {
req.session.user = response.response.user;
})
.then((response) => {
res.redirect(302, '/');
})
.catch((err) => {console.log("in error"); console.error(JSON.stringify(err));
});
}
}
When i use the URL "http://localhost:9011/oauth2/authorize?client_id="clientId"&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth-redirect", i have this message in my console :
in error {}
And nothing else. Is there someone who can help me ? Thanks in advance.