🐛 Always transform undefined to null values for user name and image in OAuth profile extraction

Closes #2199
This commit is contained in:
Baptiste Arnaud 2025-06-23 14:07:07 +02:00
parent 235bd9944b
commit b8d589931d
No known key found for this signature in database

View File

@ -132,9 +132,9 @@ if (env.CUSTOM_OAUTH_ISSUER) {
profile(profile) {
const user = {
id: getAtPath(profile, env.CUSTOM_OAUTH_USER_ID_PATH),
name: getAtPath(profile, env.CUSTOM_OAUTH_USER_NAME_PATH),
name: getAtPath(profile, env.CUSTOM_OAUTH_USER_NAME_PATH) ?? null,
email: getAtPath(profile, env.CUSTOM_OAUTH_USER_EMAIL_PATH),
image: getAtPath(profile, env.CUSTOM_OAUTH_USER_IMAGE_PATH),
image: getAtPath(profile, env.CUSTOM_OAUTH_USER_IMAGE_PATH) ?? null,
};
return userSchema
.pick({ id: true, email: true, name: true, image: true })