From 325d56edc5774e3131b0054a99f5d7ce2b4abc1d Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 3 Apr 2021 14:27:08 -0700 Subject: [PATCH] make LoginTokens designated by prefix name --- libs/auth/google.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/auth/google.js b/libs/auth/google.js index 7147c208..38c8e3ac 100644 --- a/libs/auth/google.js +++ b/libs/auth/google.js @@ -28,7 +28,7 @@ module.exports = (s,config,lang) => { columns: '*', table: "LoginTokens", where: [ - ['loginId','=',loginId], + ['loginId','=',`google-${loginId}`], ] }) if(!searchResponse.rows[0]){ @@ -36,7 +36,7 @@ module.exports = (s,config,lang) => { action: "insert", table: "LoginTokens", insert: { - loginId: loginId, + loginId: `google-${loginId}`, ke: groupKey, uid: userId, lastLogin: new Date(), @@ -52,10 +52,10 @@ module.exports = (s,config,lang) => { action: "update", table: "LoginTokens", update: { - lastLogin: response.lastLogin + lastLogin: new Date() }, where: [ - ['loginId','=',loginId], + ['loginId','=',`google-${loginId}`], ] }) response.ok = updateResponse.ok @@ -67,7 +67,7 @@ module.exports = (s,config,lang) => { action: "delete", table: "LoginTokens", where: [ - ['loginId','=',loginId], + ['loginId','=',`google-${loginId}`], ] }) response.ok = updateResponse.ok @@ -85,7 +85,7 @@ module.exports = (s,config,lang) => { columns: '*', table: "LoginTokens", where: [ - ['loginId','=',user.id], + ['loginId','=',`google-${user.id}`], ] }) if(searchResponse.rows[0]){