mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 09:28:36 +00:00
added proper error handling for user creation
This commit is contained in:
@@ -77,6 +77,7 @@ const initializePassport = async () => {
|
||||
profile: any,
|
||||
cb: any
|
||||
) => {
|
||||
try {
|
||||
const email = profile.emails[0].value;
|
||||
let user = await User.findOne({
|
||||
authProvider: AuthProvider.GOOGLE,
|
||||
@@ -104,6 +105,9 @@ const initializePassport = async () => {
|
||||
|
||||
req.providerAuthToken = providerAuthToken;
|
||||
cb(null, profile);
|
||||
} catch (err) {
|
||||
cb(err);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user