I am using the passport authenticate with 'dropbox-oauth2' to get my login token and receive my Bearer. This worked fine until about midday yesterday when it started sending me this : error_description: 'code has already been used',
error: 'invalid_grant'
To get the Dropbox authorization screen, I use this :
app.get('/dropboxLogin', passport.authenticate('dropbox-oauth2'));
app.get('/auth/dropbox/callback',
passport.authenticate('dropbox-oauth2', { failureRedirect: '/', params:{'response_type':'token'} }),
function(req, res)
{
// Successful authentication, redirect home.
res.render('index', { title:'Dropbox Login', body:res});
});
Once I've received my token I run : axios({
method : 'post',
url : 'https://api.dropboxapi.com/oauth2/token',
params :
{
code : request.body.code,
grant_type : 'authorization_code',
redirect_uri : 'http://localhost:9000/callback',
client_id : '##############',
client_secret : '##############'
}
})
Thats when I get the error.