Skip to content

ashishforgrz/ISGAPPSEC-573

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

ISGAPPSEC-573

For using UPDATE command in mysql - function revokeAccessToken(token, client, user) { return OAuthAccessToken.findOne({ where: { client_id: client.id, user_id: user.id }, }) .then(function () { var sql = "UPDATE oauth_access_tokens SET expires=? WHERE client_id=?, user_id=?"; const expiredToken = token; expiredToken.accessTokenExpiresAt = new Date(); OAuthAccessToken.query(sql,[expiredToken.accessTokenExpiresAt, client.id, user.id ], function (err, result){ if (err) throw err; }) }) .catch(function (err) { logger.error('revokeToken1 - Err: ', err); }); }

Inbuilt in SQL scripts - function revokeAccessToken(token, client, user) { return OAuthAccessToken.findOne({ where: { client_id: client.id, user_id: user.id }, }) .then(function () { const expiredToken = token; expiredToken.accessTokenExpiresAt = new Date(); var sql = UPDATE oauth_access_tokens SET expires=${expiredToken.accessTokenExpiresAt} WHERE client_id=${client.id}, user_id=${user.id}; OAuthAccessToken.query(sql, function (err, result){ if (err) throw err; }) }) .catch(function (err) { logger.error('revokeToken1 - Err: ', err); }); }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published