feat: Initial login / logout API endpoints
This commit is contained in:
18
wp-content/themes/headless/shared/types/auth.d.ts
vendored
Normal file
18
wp-content/themes/headless/shared/types/auth.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
declare module "#auth-utils" {
|
||||
interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
interface UserSession {
|
||||
loggedInAt: string;
|
||||
}
|
||||
|
||||
interface SecureSessionData {
|
||||
authToken: string;
|
||||
refreshToken: string;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as z from "zod";
|
||||
|
||||
export const authLoginFormSchema = z.object({
|
||||
username: z.email("Courriel invalide"),
|
||||
password: z.string("Veuillez saisir votre mot de passe"),
|
||||
});
|
||||
export type AuthLoginForm = z.infer<typeof authLoginFormSchema>;
|
||||
Reference in New Issue
Block a user