feat: Implement identity management and safety checks

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 14:41:18 +00:00
parent e42853b797
commit 6430777dc0
4 changed files with 589 additions and 68 deletions

33
src/types/identity.ts Normal file
View File

@@ -0,0 +1,33 @@
/**
* Type definitions for user identity and OAuth provider management
*/
export interface UserIdentity {
id: string;
user_id: string;
identity_data: {
email?: string;
full_name?: string;
avatar_url?: string;
[key: string]: any;
};
provider: 'google' | 'discord' | 'email' | 'github' | string;
created_at: string;
updated_at: string;
last_sign_in_at: string;
}
export type OAuthProvider = 'google' | 'discord';
export interface IdentitySafetyCheck {
canDisconnect: boolean;
reason?: 'last_identity' | 'no_password_backup' | 'safe';
hasPasswordAuth: boolean;
totalIdentities: number;
oauthIdentities: number;
}
export interface IdentityOperationResult {
success: boolean;
error?: string;
}