Skip to content

Commit bd70c87

Browse files
committed
fix time
1 parent 3df46e7 commit bd70c87

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var checkAuthToken = function (authToken) {
1616
throw new Error('401 Unauthorized');
1717
}
1818
return models.UserTokens.findOne({
19-
where: {tokens: authToken, uid: users.id, expires_at: { gt: moment().format('YYYY-MM-DD hh:mm:ss') }}
19+
where: {tokens: authToken, uid: users.id, expires_at: { gt: moment().format('YYYY-MM-DD HH:mm:ss') }}
2020
})
2121
.then(function(tokenInfo){
2222
if (_.isEmpty(tokenInfo)){

core/services/account-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ proto.createAccessKey = function (uid, newAccessKey, isSession, ttl, friendlyNam
8181
description: description,
8282
is_session: isSession ? true : false,
8383
created_by: createdBy,
84-
expires_at: moment().add(ttl/1000, 'seconds').format('YYYY-MM-DD hh:mm:ss'),
85-
created_at: moment().format('YYYY-MM-DD hh:mm:ss'),
84+
expires_at: moment().add(ttl/1000, 'seconds').format('YYYY-MM-DD HH:mm:ss'),
85+
created_at: moment().format('YYYY-MM-DD HH:mm:ss'),
8686
});
8787
};
8888

routes/accessKeys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ router.patch('/:name', middleware.checkToken, function(req, res, next){
8383
.then(function () {
8484
var moment = require('moment');
8585
if (ttl > 0) {
86-
var newExp = moment(token.get('expires_at')).add(ttl/1000, 'seconds').format('YYYY-MM-DD hh:mm:ss')
86+
var newExp = moment(token.get('expires_at')).add(ttl/1000, 'seconds').format('YYYY-MM-DD HH:mm:ss')
8787
token.set('expires_at', newExp)
8888
}
8989
if (friendlyName.length > 0) {

0 commit comments

Comments
 (0)