Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

In express redirect user to external url

//use res.redirect to redirect user to external url
app.get('/api/auth/discord', async (req, res) => {
  res.redirect(
    'https://discord.com/api/oauth2/authorize?client_id=989911480243748924&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fapi%2Fauth%2Fdiscord%2Fredirect&response_type=code&scope=identify%20guilds'
  );
});
 
PREVIOUS NEXT
Tagged: #In #express #redirect #user #external #url
ADD COMMENT
Topic
Name
6+1 =