This commit is contained in:
2025-12-31 19:55:43 +01:00
parent 8260bf7baf
commit 167e82a52b
66 changed files with 5124 additions and 228 deletions

View File

@@ -0,0 +1,37 @@
import { Result } from '@core/shared/application/Result';
export interface PasswordResetRequest {
email: string;
token: string;
expiresAt: Date;
userId: string;
used?: boolean;
}
export interface IMagicLinkRepository {
/**
* Create a password reset request
*/
createPasswordResetRequest(request: PasswordResetRequest): Promise<void>;
/**
* Find a password reset request by token
*/
findByToken(token: string): Promise<PasswordResetRequest | null>;
/**
* Mark a token as used
*/
markAsUsed(token: string): Promise<void>;
/**
* Check rate limiting for an email
* Returns Result.ok if allowed, Result.err if rate limited
*/
checkRateLimit(email: string): Promise<Result<void, { message: string }>>;
/**
* Clean up expired tokens
*/
cleanupExpired(): Promise<void>;
}

View File

@@ -7,7 +7,6 @@
export interface UserCredentials {
email: string;
passwordHash: string;
salt: string;
}
export interface StoredUser {
@@ -15,7 +14,7 @@ export interface StoredUser {
email: string;
displayName: string;
passwordHash: string;
salt: string;
salt?: string;
primaryDriverId?: string | undefined;
createdAt: Date;
}