0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Merge pull request #3621 from sebgie/fix-refresh-token

Fix token refresh
This commit is contained in:
Hannah Wolfe 2014-08-06 10:34:20 +01:00
commit c95c9b45cb

View file

@ -144,8 +144,10 @@ var middleware = {
rateSigninPeriod = config.rateSigninPeriod || 3600,
rateSigninAttempts = config.rateSigninAttempts || 10;
if (req.body.username) {
if (req.body.username && req.body.grant_type === 'password') {
loginSecurity.push({ip: remoteAddress, time: currentTime, email: req.body.username});
} else if (req.body.grant_type === 'refresh_token') {
return next();
} else {
return next(new errors.BadRequestError('No username.'));
}