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:
commit
c95c9b45cb
1 changed files with 3 additions and 1 deletions
|
@ -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.'));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue