nodeJS_OAuth2Example icon indicating copy to clipboard operation
nodeJS_OAuth2Example copied to clipboard

Issue saving access token

Open rburckner opened this issue 7 years ago • 0 comments

I am new to Node JS and GitHub. I found your example very enlightening. I hope to tailor this for my needs but wanted to report a problem I had saving a token using your code.

I had to make the following two changes:

  • In your "accessTokenModel.js", function "saveAccessToken", I had to modify the call to: "accessTokensDBHelper.saveAccessToken(accessToken, user.username, callback)", and
  • In your "accessTokensDBHelper.js", function "saveAccessToken", I had to modify the SQL query to INSERT INTO access_tokens (access_token, user_id) VALUES ("${accessToken}", "${userID}") ON DUPLICATE KEY UPDATE access_token = "${accessToken}";

I haven't examined this much so I am not certain if this is the correct fix.

rburckner avatar Apr 29 '18 05:04 rburckner