feat: redesign match play and add broadcast tooling
This commit is contained in:
21
src/lib/auth-identity.ts
Normal file
21
src/lib/auth-identity.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/** Better Auth requires an email internally; this is never a contact address. */
|
||||
export const AUTH_EMAIL_DOMAIN = 'identity.invalid';
|
||||
|
||||
export function contactEmail(value: string | null | undefined): string | null {
|
||||
const email = value?.trim().toLowerCase();
|
||||
if (!email || /@(?:osu\.local|discord\.local|identity\.invalid)$/.test(email)) return null;
|
||||
return email;
|
||||
}
|
||||
|
||||
export function newAuthIdentity(): string {
|
||||
return `${crypto.randomUUID()}@${AUTH_EMAIL_DOMAIN}`;
|
||||
}
|
||||
|
||||
export interface ConnectionProfile {
|
||||
username: string;
|
||||
image: string | null;
|
||||
email: string | null;
|
||||
emailVerified: boolean;
|
||||
countryCode?: string | null;
|
||||
globalRank?: number | null;
|
||||
}
|
||||
Reference in New Issue
Block a user