This commit is contained in:
2026-02-03 20:00:56 +08:00
parent c4a9247cad
commit d5dde77ee9
13 changed files with 409 additions and 147 deletions

View File

@@ -0,0 +1,50 @@
// Service layer DTOs for auth module
// Sign up input/output
export type ServiceInputSignUp = {
email: string;
username: string;
password: string; // plain text, will be hashed by better-auth
name: string;
};
export type ServiceOutputSignUp = {
success: boolean;
userId?: string;
email?: string;
username?: string;
};
// Sign in input/output
export type ServiceInputSignIn = {
identifier: string; // email or username
password: string;
};
export type ServiceOutputSignIn = {
success: boolean;
userId?: string;
email?: string;
username?: string;
sessionToken?: string;
};
// Sign out input/output
export type ServiceInputSignOut = {
sessionId?: string;
};
export type ServiceOutputSignOut = {
success: boolean;
};
// User existence check
export type ServiceInputCheckUserExists = {
email?: string;
username?: string;
};
export type ServiceOutputCheckUserExists = {
emailExists: boolean;
usernameExists: boolean;
};