Fixing some errors

This commit is contained in:
Ben Hardill
2018-06-20 22:47:10 +01:00
parent a56193d98a
commit b4b59cda09
2 changed files with 8 additions and 5 deletions

View File

@@ -45,7 +45,8 @@ server.exchange(oauth2orize.exchange.code({
OAuth.RefreshToken.findOne({application:application, user: grant.user},function(error, refreshToken){
if (refreshToken){
var expires = Math.round((token.expires - (new Date().getTime()))/1000);
done(null,token.token, refreshToken.token,{token_type: 'Bearer', expires_in: expires, scope: token.scope});
done(null,token.token, refreshToken.token,{token_type: 'Bearer', expires_in: expires});
console.log("sent expires_in: " + expires);
} else {
// Shouldn't get here unless there is an error as there
// should be a refresh token if there is an access token