Skip to content

Commit

Permalink
Debug 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1uev committed Sep 12, 2024
1 parent 86b105d commit ad11e6f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/server/auth/providers/google/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ad11e6f

Please sign in to comment.