fix(auth): enable email verification for SSO and user creation

Updated the SSO configuration to trust verified emails and modified user creation to set emailVerified to true by default. This enhances security and ensures that user email verification is properly handled.
This commit is contained in:
Mauricio Siu
2026-07-21 02:50:22 -06:00
parent 25370cac30
commit e9b51667e2
2 changed files with 2 additions and 2 deletions

View File

@@ -419,7 +419,7 @@ const createBetterAuth = () =>
enableMetadata: true,
references: "user",
}),
sso(),
sso({ trustEmailVerified: true }),
scim({
beforeSCIMTokenGenerated: async ({ user }) => {
const dbUser = await db.query.user.findFirst({

View File

@@ -430,7 +430,7 @@ export const createOrganizationUserWithCredentials = async ({
.insert(user)
.values({
email: normalizedEmail,
emailVerified: false,
emailVerified: true,
updatedAt: now,
})
.returning({