Fix SAML duplicate accounts when signing in the first time on an existing account

This commit is contained in:
Carlos Monastyrski
2025-08-08 18:20:47 -03:00
parent ca1f5eaca3
commit c2cea8cffc
6 changed files with 81 additions and 22 deletions
+4 -1
View File
@@ -17,6 +17,9 @@ export const registerUserRouter = async (server: FastifyZodProvider) => {
})
},
schema: {
headers: z.object({
referer: z.string().trim()
}),
body: z.object({
username: z.string().trim()
}),
@@ -25,7 +28,7 @@ export const registerUserRouter = async (server: FastifyZodProvider) => {
}
},
handler: async (req) => {
await server.services.user.sendEmailVerificationCode(req.body.username);
await server.services.user.sendEmailVerificationCode(req.body.username, req.headers.referer);
return {};
}
});