diff --git a/src/routes/oauth2-signin.ts b/src/routes/oauth2-signin.ts index 45352db..1eead19 100644 --- a/src/routes/oauth2-signin.ts +++ b/src/routes/oauth2-signin.ts @@ -58,12 +58,13 @@ export const addRoute = (env: RouteInitEnvironment) => { if (contentType === 'image/png') { //state.provider === 'google' && // Don't accept image/png, because it's probably a placeholder image. Google does this by creating a png with people's initials user_details.picture = []; - return; } - const image = await response.arrayBuffer(); - let buff = Buffer.from(image); - best.url = `data:${contentType};base64,${buff.toString('base64')}`; - user_details.picture = [best]; // Only keep the best one + else { + const image = await response.arrayBuffer(); + let buff = Buffer.from(image); + best.url = `data:${contentType};base64,${buff.toString('base64')}`; + user_details.picture = [best]; // Only keep the best one + } } catch(err) { env.debug.warn(`Could not fetch profile picture from "${best.url}": `, err);