Browse Source

fix(Auth with GitHub): access token wasn't being saved to db

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
7f12aa5c2f
2 changed files with 3 additions and 5 deletions
  1. 0 2
      backend/logic/actions/users.js
  2. 3 3
      backend/logic/app.js

+ 0 - 2
backend/logic/actions/users.js

@@ -238,8 +238,6 @@ export default {
 				}
 			],
 			async err => {
-				console.log(err);
-
 				if (err && err !== true) {
 					err = await UtilsModule.runJob("GET_ERROR", { error: err }, this);
 					this.log(

+ 3 - 3
backend/logic/app.js

@@ -198,7 +198,7 @@ class _AppModule extends CoreClass {
 													$set: {
 														"services.github": {
 															id: github.data.id,
-															accessToken
+															access_token: accessToken
 														}
 													}
 												},
@@ -283,7 +283,7 @@ class _AppModule extends CoreClass {
 							}
 
 							return next(null, {
-								_id, // TODO Check if exists
+								_id,
 								username: body.login,
 								name: body.name,
 								location: body.location,
@@ -293,7 +293,7 @@ class _AppModule extends CoreClass {
 									verificationToken
 								},
 								services: {
-									github: { id: body.id, accessToken }
+									github: { id: body.id, access_token: accessToken }
 								}
 							});
 						},