mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 04:44:28 +00:00
fix(auth): fix invite code bypass vulnerability
This commit is contained in:
@@ -42,6 +42,18 @@ export const auth = betterAuth({
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
const isValid = await inviteService.validateInvite(inviteCode)
|
||||
if (!isValid) {
|
||||
return ctx.json(
|
||||
{
|
||||
error: 'Invalid or expired invite code',
|
||||
},
|
||||
{
|
||||
status: 400,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user