docs: record D4 integration inputs
This commit is contained in:
1 parent
fdf3a328ce
commit
78ed3c1103
11 files changed
+162
-29
No files matched your search
@@ -8,7 +8,7 @@ import {
|
||||
|
||||
export type UserRole = 'user' | 'admin'
|
||||
export type UserStatus = 'active' | 'disabled'
|
||||
export type AccountKind = 'email' | 'phone'
|
||||
export type AccountKind = 'email' | 'phone' | 'username'
|
||||
|
||||
export interface UserRecord {
|
||||
id: string
|
||||
@@ -368,7 +368,9 @@ export function normalizeAccount(value: string) {
|
||||
}
|
||||
|
||||
export function accountKind(account: string): AccountKind {
|
||||
return account.includes('@') ? 'email' : 'phone'
|
||||
if (account.includes('@')) return 'email'
|
||||
if (/^\+?[0-9][0-9\s-]{6,19}$/.test(account)) return 'phone'
|
||||
return 'username'
|
||||
}
|
||||
|
||||
export function validateAccount(account: string) {
|
||||
|
||||
Reference in new issue
Block a user