fix(generic-oauth): async mapProfileToUser breaks

After debugging for an unacceptable amount of time, I found out that our generic oauth plugin with `mapProfileToUser` breaks when users apply `async` to their function despite our function signature supporting this. It breaks because we didn't use `await`...
This commit is contained in:
ping-maxwell
2025-10-31 00:50:43 +10:00
parent 7b65ddd02c
commit 3c2959e985

View File

@@ -329,7 +329,7 @@ export const genericOAuth = (options: GenericOAuthOptions) => {
emailVerified: userInfo?.emailVerified,
image: userInfo?.image,
name: userInfo?.name,
...c.mapProfileToUser?.(userInfo),
...(await c.mapProfileToUser?.(userInfo)),
},
data: userInfo,
};