From 532cfdad2e3e22d00baeeeebed4aa64ecf5d2955 Mon Sep 17 00:00:00 2001 From: counter Date: Sun, 15 Jan 2023 18:24:08 -0800 Subject: [PATCH] adding user record --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 9389cb8..b9132e1 100644 --- a/app.js +++ b/app.js @@ -300,13 +300,15 @@ async function get_app_server() { client.setCredentials(tokens); const oauth2 = google.oauth2({version: 'v2', auth: client}); const googleUserProfile = await oauth2.userinfo.v2.me.get(); - console.log(JSON.stringify(googleUserProfile)) const email = googleUserProfile.data.email const [user, created] = await Users.findOrCreate({ where: { 'email': email } }); if(created){ user.path = makeRandomPath(20); user.save(); } + console.log(req.session); + console.log(user); + console.log("POTATO"); req.session.email = user.email; req.session.authenticated = true; res.send(`Hello ${user.email}, your path is ${user.path}!`);