I'm giving the scope field to the passport.authenticate() but it doesn't redirect me to the Instagram auth URL with query scope parameters.
Here is my code
Router.get('/instagram/callback', (req, res) => {
passport.authenticate('instagram', {
scope: ['user_profile', 'user_media'],
successRedirect: '/profile',
failureRedirect: '/login',
session: true
});
res.json({'status': 'success'});
});
It redirects the user to the https://www.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https://localhost:3000/auth&client_id=my_client_id
As you can see there is no scope query parameter. And unfortunately, Instagram gives an error like this;
{
"error_type": "OAuthException",
"code": 400,
"error_message": "Invalid scope: []"
}
How can I add scope?
I'm giving the scope field to the passport.authenticate() but it doesn't redirect me to the Instagram auth URL with query scope parameters.
Here is my code
It redirects the user to the
https://www.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https://localhost:3000/auth&client_id=my_client_idAs you can see there is no scope query parameter. And unfortunately, Instagram gives an error like this;
How can I add scope?