From ad11e6f4d277c6bdf15f171e2fd77cfb6870514a Mon Sep 17 00:00:00 2001 From: Pavel Baluev Date: Thu, 12 Sep 2024 10:55:04 +0200 Subject: [PATCH] Debug 1 --- src/server/auth/providers/google/index.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/server/auth/providers/google/index.ts b/src/server/auth/providers/google/index.ts index 9fe90d0c..10724c53 100644 --- a/src/server/auth/providers/google/index.ts +++ b/src/server/auth/providers/google/index.ts @@ -61,13 +61,20 @@ export const plugin: FastifyPluginCallback = async ( if (user?.deletedAt) { return reply.redirect('/') } - if (!!data.picture) { - // should be used only for userpic provided from Google Account! - // -c parameter means the image was cropped - // e.g will match =s96-c =s128 - data.picture = data.picture.replace(/=s\d+(-c)?$/, `=s${312}$1`) - } + // if (!!data.picture) { + // // should be used only for userpic provided from Google Account! + // // -c parameter means the image was cropped + // // e.g will match =s96-c =s128 + // data.picture = data.picture.replace(/=s\d+(-c)?$/, `=s${312}$1`) + // } if (!user) { + fastify.log.info({ + fullName: data.name, + email: data.email, + avatar: data.picture, + avatarChanged: data.picture.replace(/=s\d+(-c)?$/, `=s${312}$1`), + roles: [appConfig.getDefaultUserRoleByEmail(data.email)], + }, 'Creating new user') user = await fastify.db.User.create({ fullName: data.name, email: data.email,