finalized signup/signin ux regarding redirects

This commit is contained in:
Sheen Capadngan
2023-05-07 20:54:30 +08:00
parent ea86e59d4f
commit 4c434555a4
9 changed files with 46 additions and 12 deletions
+2 -1
View File
@@ -74,7 +74,7 @@ const initializePassport = async () => {
let user = await User.findOne({
authProvider: AuthProvider.GOOGLE,
authId: profile.id,
})
}).select('+publicKey')
if (!user) {
user = await new User({
@@ -89,6 +89,7 @@ const initializePassport = async () => {
userId: user._id.toString(),
email: user.email,
authProvider: user.authProvider,
isUserCompleted: !!user.publicKey
},
expiresIn: await getJwtProviderAuthLifetime(),
secret: await getJwtProviderAuthSecret(),