Implement OpenID Connect Authentication Strategy (works with Keycloak, Authentik etc.)

This commit is contained in:
Amruth Pillai
2025-01-13 15:56:29 +01:00
parent 0f8f2fe560
commit eb7813ac6f
20 changed files with 320 additions and 18 deletions

View File

@ -1,6 +1,6 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "zod";
const authProvidersSchema = z.array(z.enum(["email", "github", "google"]));
const authProvidersSchema = z.array(z.enum(["email", "github", "google", "openid"]));
export class AuthProvidersDto extends createZodDto(authProvidersSchema) {}

View File

@ -26,7 +26,7 @@ export const userSchema = z.object({
locale: z.string().default("en-US"),
emailVerified: z.boolean().default(false),
twoFactorEnabled: z.boolean().default(false),
provider: z.enum(["email", "github", "google"]).default("email"),
provider: z.enum(["email", "github", "google", "openid"]).default("email"),
createdAt: dateSchema,
updatedAt: dateSchema,
});