-
Notifications
You must be signed in to change notification settings - Fork 991
/
SupportedAuthClients.ts
104 lines (98 loc) · 2.7 KB
/
SupportedAuthClients.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { auth0 } from './auth0'
import type { Auth0, Auth0User } from './auth0'
import { AuthClient } from './AuthClient'
import { azureActiveDirectory } from './azureActiveDirectory'
import type {
AzureActiveDirectory,
AzureActiveDirectoryUser,
} from './azureActiveDirectory'
import { clerk } from './clerk'
import type { Clerk, ClerkUser } from './clerk'
import { custom } from './custom'
import type { Custom } from './custom'
import { dbAuth } from './dbAuth'
import type { DbAuth, DbAuthConfig } from './dbAuth'
import { ethereum } from './ethereum'
import type { Ethereum, EthereumUser } from './ethereum'
import { firebase } from './firebase'
import type { FirebaseClient, FirebaseUser } from './firebase'
import { goTrue } from './goTrue'
import type { GoTrue, GoTrueUser } from './goTrue'
import { magicLink } from './magicLink'
import type { MagicLink, MagicUser } from './magicLink'
import { netlify } from './netlify'
import type { NetlifyIdentity } from './netlify'
import { nhost } from './nhost'
import type { Nhost, NhostUser } from './nhost'
import { okta } from './okta'
import type { Okta, OktaUser } from './okta'
import { supabase } from './supabase'
import type { Supabase, SupabaseUser } from './supabase'
import { supertokens } from './supertokens'
import type { SuperTokensUser, SuperTokens } from './supertokens'
export type AuthFactory<
ClientType,
ConfigType,
AuthClientType extends AuthClient
> = (
client: ClientType,
config: ConfigType
) => AuthClientType | Promise<AuthClientType>
export const typesToClients: Record<string, AuthFactory<any, any, any>> = {
netlify,
auth0,
azureActiveDirectory,
dbAuth,
goTrue,
magicLink,
firebase,
supabase,
ethereum,
nhost,
clerk,
supertokens,
okta,
/** Don't we support your auth client? No problem, define your own the `custom` type! */
custom,
}
export type SupportedAuthClients =
| Auth0
| AzureActiveDirectory
| DbAuth
| GoTrue
| NetlifyIdentity
| MagicLink
| FirebaseClient
| Supabase
| Clerk
| Ethereum
| Nhost
| SuperTokens
| Okta
| Custom
export type SupportedAuthTypes = keyof typeof typesToClients
export type SupportedAuthConfig = DbAuthConfig
export type { Auth0User }
export type { AzureActiveDirectoryUser }
export type { DbAuth }
export type { ClerkUser }
export type { FirebaseUser }
export type { GoTrueUser }
export type { MagicUser }
export type { SupabaseUser }
export type { EthereumUser }
export type { NhostUser }
export type { SuperTokensUser }
export type { OktaUser }
export type SupportedUserMetadata =
| Auth0User
| AzureActiveDirectoryUser
| ClerkUser
| FirebaseUser
| GoTrueUser
| MagicUser
| SupabaseUser
| EthereumUser
| NhostUser
| SuperTokensUser
| OktaUser