@@ -27,7 +27,7 @@ module.exports.getAccessToken = function(bearerToken) {
27
27
* Get client.
28
28
*/
29
29
30
- module . exports . getClient = function * ( clientId , clientSecret ) {
30
+ module . exports . getClient = function ( clientId , clientSecret ) {
31
31
return pg . query ( 'SELECT client_id, client_secret, redirect_uri FROM oauth_clients WHERE client_id = $1 AND client_secret = $2' , [ clientId , clientSecret ] )
32
32
. then ( function ( result ) {
33
33
var oAuthClient = result . rows [ 0 ] ;
@@ -48,7 +48,7 @@ module.exports.getClient = function *(clientId, clientSecret) {
48
48
* Get refresh token.
49
49
*/
50
50
51
- module . exports . getRefreshToken = function * ( bearerToken ) {
51
+ module . exports . getRefreshToken = function ( bearerToken ) {
52
52
return pg . query ( 'SELECT access_token, access_token_expires_on, client_id, refresh_token, refresh_token_expires_on, user_id FROM oauth_tokens WHERE refresh_token = $1' , [ bearerToken ] )
53
53
. then ( function ( result ) {
54
54
return result . rowCount ? result . rows [ 0 ] : false ;
@@ -59,7 +59,7 @@ module.exports.getRefreshToken = function *(bearerToken) {
59
59
* Get user.
60
60
*/
61
61
62
- module . exports . getUser = function * ( username , password ) {
62
+ module . exports . getUser = function ( username , password ) {
63
63
return pg . query ( 'SELECT id FROM users WHERE username = $1 AND password = $2' , [ username , password ] )
64
64
. then ( function ( result ) {
65
65
return result . rowCount ? result . rows [ 0 ] : false ;
@@ -70,7 +70,7 @@ module.exports.getUser = function *(username, password) {
70
70
* Save token.
71
71
*/
72
72
73
- module . exports . saveAccessToken = function * ( token , client , user ) {
73
+ module . exports . saveAccessToken = function ( token , client , user ) {
74
74
return pg . query ( 'INSERT INTO oauth_tokens(access_token, access_token_expires_on, client_id, refresh_token, refresh_token_expires_on, user_id) VALUES ($1, $2, $3, $4)' , [
75
75
token . accessToken ,
76
76
token . accessTokenExpiresOn ,
0 commit comments