@authowl/core 0.22.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/chunk-LBCOMERN.js +1 -0
- package/dist/chunk-YL2FF2VS.js +2 -0
- package/dist/{client-BwZ1bqU4.d.cts → config-ZhNp65dI.d.cts} +496 -254
- package/dist/{client-DXypEWpf.d.ts → config-ZhNp65dI.d.ts} +496 -254
- package/dist/{idempotency-BWMPd3B7.d.ts → idempotency-BbNZaxT8.d.ts} +24 -24
- package/dist/{idempotency-BfRYS8qn.d.cts → idempotency-CG0ZpMnW.d.cts} +24 -24
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +3 -3
- package/dist/messages.cjs +1 -1
- package/dist/messages.d.cts +8 -0
- package/dist/messages.d.ts +8 -0
- package/dist/messages.js +1 -1
- package/dist/native.cjs +2 -2
- package/dist/native.d.cts +7 -8
- package/dist/native.d.ts +7 -8
- package/dist/native.js +1 -1
- package/dist/privacy.d.cts +2 -2
- package/dist/privacy.d.ts +2 -2
- package/dist/public-config-BfuiC8Ph.d.ts +241 -0
- package/dist/public-config-DdTDwDF7.d.cts +241 -0
- package/dist/server.cjs +2 -2
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DVVGVPDH.js +0 -1
- package/dist/chunk-IB6TFQFD.js +0 -2
- package/dist/organization-membership-BIify9hZ.d.cts +0 -450
- package/dist/organization-membership-BIify9hZ.d.ts +0 -450
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { R as ResolvedAuthConfig } from './config-ZhNp65dI.js';
|
|
2
|
+
|
|
3
|
+
type EnvironmentType = 'development' | 'production';
|
|
4
|
+
/**
|
|
5
|
+
* The public, publishable-key-safe project config the SDK renders its sign-in
|
|
6
|
+
* UI from (server contract CONTRACTS §2, `GET /api/projects/:id/public-config`).
|
|
7
|
+
* Nothing here is secret. Method slugs are canonical snake_case.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A project's configured bot challenge.
|
|
11
|
+
*
|
|
12
|
+
* `provider` is deliberately a plain string rather than a union of the ones this
|
|
13
|
+
* SDK can render. A project may be switched to a provider that predates the
|
|
14
|
+
* copy of the SDK an application is running, and the difference between
|
|
15
|
+
* "no challenge configured" and "a challenge this build cannot render" is the
|
|
16
|
+
* difference between signing in and a silent 403 the user cannot act on. Keeping
|
|
17
|
+
* the slug lets the renderer say which provider it does not know.
|
|
18
|
+
*/
|
|
19
|
+
interface CaptchaConfig {
|
|
20
|
+
provider: string;
|
|
21
|
+
siteKey: string;
|
|
22
|
+
}
|
|
23
|
+
type PublicConfig = {
|
|
24
|
+
/** Stable workspace product container shared by its environments. */
|
|
25
|
+
applicationId: string;
|
|
26
|
+
/** Stable tenant id for the exact environment selected by the publishable key. */
|
|
27
|
+
environmentId: string;
|
|
28
|
+
/** Environment class that determines key prefixes and billing treatment. */
|
|
29
|
+
environmentType: EnvironmentType;
|
|
30
|
+
/**
|
|
31
|
+
* Authentication endpoint used by this SDK instance. Hosted portals and
|
|
32
|
+
* custom domains keep this same-origin even when the stable JWT issuer uses
|
|
33
|
+
* the platform's canonical origin.
|
|
34
|
+
*/
|
|
35
|
+
authBaseUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Public acquisition mode. Optional only for rolling compatibility with
|
|
38
|
+
* servers released before waitlist support.
|
|
39
|
+
*/
|
|
40
|
+
signUp?: {
|
|
41
|
+
mode: 'open' | 'restricted' | 'allowlist' | 'waitlist';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Identity and credential lifecycle policy. Optional only for rolling
|
|
45
|
+
* compatibility with AuthOwl servers released before plan 35.
|
|
46
|
+
*/
|
|
47
|
+
authentication?: {
|
|
48
|
+
email: {
|
|
49
|
+
signUp: boolean;
|
|
50
|
+
signIn: Array<'password' | 'magic_link' | 'email_otp'>;
|
|
51
|
+
};
|
|
52
|
+
phone: {
|
|
53
|
+
signUp: boolean;
|
|
54
|
+
signIn: boolean;
|
|
55
|
+
};
|
|
56
|
+
password: {
|
|
57
|
+
signUp: boolean;
|
|
58
|
+
add: boolean;
|
|
59
|
+
/** Server-owned password length policy. Optional for rolling compatibility. */
|
|
60
|
+
minLength?: number;
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
};
|
|
63
|
+
passkey: {
|
|
64
|
+
signIn: boolean;
|
|
65
|
+
add: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The domain this environment binds passkeys to. Absent or null means the
|
|
68
|
+
* server derives it from the auth host, which is what every server before
|
|
69
|
+
* this field did - so treating both the same keeps a new SDK correct
|
|
70
|
+
* against an older server.
|
|
71
|
+
*/
|
|
72
|
+
relyingPartyId?: string | null;
|
|
73
|
+
};
|
|
74
|
+
username: {
|
|
75
|
+
collectOnSignUp: boolean;
|
|
76
|
+
signIn: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/** Email ownership ceremony selected by the project. */
|
|
80
|
+
emailVerification?: {
|
|
81
|
+
required: boolean;
|
|
82
|
+
method: 'link' | 'code';
|
|
83
|
+
};
|
|
84
|
+
/** End-user profile fields and self-service permissions. */
|
|
85
|
+
userModel?: {
|
|
86
|
+
requireEmail: boolean;
|
|
87
|
+
firstLastName: boolean;
|
|
88
|
+
emailChange: boolean;
|
|
89
|
+
accountDeletion: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* MFA presentation contract. Backup codes follow TOTP and are not an
|
|
93
|
+
* independently configurable authentication method.
|
|
94
|
+
*/
|
|
95
|
+
mfa?: {
|
|
96
|
+
totp: boolean;
|
|
97
|
+
required: boolean;
|
|
98
|
+
backupCodes: boolean;
|
|
99
|
+
/** Whether an emailed code may recover a TOTP challenge. Defaults to true for older servers. */
|
|
100
|
+
emailOtpFallback?: boolean;
|
|
101
|
+
/** Whether a successful challenge may remember this browser. Defaults to true for older servers. */
|
|
102
|
+
trustDevice?: boolean;
|
|
103
|
+
};
|
|
104
|
+
branding: {
|
|
105
|
+
appName?: string;
|
|
106
|
+
logoUrl?: string;
|
|
107
|
+
/** Whether the application name is visible beside the logo. */
|
|
108
|
+
showAppName?: boolean;
|
|
109
|
+
/** Alignment of the brand identity within managed component headers. */
|
|
110
|
+
alignment?: 'left' | 'center' | 'right';
|
|
111
|
+
primaryColor?: string;
|
|
112
|
+
theme?: 'light' | 'dark' | 'system';
|
|
113
|
+
};
|
|
114
|
+
/** Canonical method slugs, e.g. "password", "magic_link", "passkey". */
|
|
115
|
+
enabledMethods: string[];
|
|
116
|
+
/** Configured social provider ids, e.g. "google". */
|
|
117
|
+
socialProviders: string[];
|
|
118
|
+
/**
|
|
119
|
+
* Public OAuth client ids keyed by provider. Optional for rolling compatibility
|
|
120
|
+
* with servers released before Google One Tap support.
|
|
121
|
+
*/
|
|
122
|
+
socialProviderClientIds?: Record<string, string>;
|
|
123
|
+
/**
|
|
124
|
+
* When true, an email/password sign-up does not create a session - the user
|
|
125
|
+
* must confirm their address first. <SignUp/> shows a "check your email" state
|
|
126
|
+
* instead of redirecting. Always false unless password sign-up is enabled.
|
|
127
|
+
*/
|
|
128
|
+
requireEmailVerification: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Legal consent gate. When `required`, <SignUp/> shows an acceptance checkbox
|
|
131
|
+
* linking `termsUrl`/`privacyUrl` and blocks sign-up until it's checked, echoing
|
|
132
|
+
* `version` back so the server records and enforces it. `required` is true only
|
|
133
|
+
* when the project both requires consent and has a document URL to link.
|
|
134
|
+
*/
|
|
135
|
+
legal: {
|
|
136
|
+
termsUrl?: string;
|
|
137
|
+
privacyUrl?: string;
|
|
138
|
+
version: number;
|
|
139
|
+
required: boolean;
|
|
140
|
+
};
|
|
141
|
+
/** Published, bilingual privacy notices and optional consent purposes. */
|
|
142
|
+
privacy?: {
|
|
143
|
+
notices: Array<{
|
|
144
|
+
noticeId: string;
|
|
145
|
+
noticeVersionId: string;
|
|
146
|
+
code: string;
|
|
147
|
+
version: number;
|
|
148
|
+
title: {
|
|
149
|
+
en: string;
|
|
150
|
+
ar: string;
|
|
151
|
+
};
|
|
152
|
+
body: {
|
|
153
|
+
en: string;
|
|
154
|
+
ar: string;
|
|
155
|
+
};
|
|
156
|
+
digest: {
|
|
157
|
+
en: string;
|
|
158
|
+
ar: string;
|
|
159
|
+
};
|
|
160
|
+
activityCodes: string[];
|
|
161
|
+
purposeCodes: string[];
|
|
162
|
+
effectiveFrom: string;
|
|
163
|
+
}>;
|
|
164
|
+
consentPurposes: Array<{
|
|
165
|
+
purposeId: string;
|
|
166
|
+
purposeVersionId: string;
|
|
167
|
+
code: string;
|
|
168
|
+
version: number;
|
|
169
|
+
title: {
|
|
170
|
+
en: string;
|
|
171
|
+
ar: string;
|
|
172
|
+
};
|
|
173
|
+
description: {
|
|
174
|
+
en: string;
|
|
175
|
+
ar: string;
|
|
176
|
+
};
|
|
177
|
+
digest: {
|
|
178
|
+
en: string;
|
|
179
|
+
ar: string;
|
|
180
|
+
};
|
|
181
|
+
activityCodes: string[];
|
|
182
|
+
dataCategories: string[];
|
|
183
|
+
}>;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Whether the project lets signed-in users enrol a second factor (TOTP). A
|
|
187
|
+
* capability flag, not a sign-in method (so it's absent from `enabledMethods`):
|
|
188
|
+
* gate an "enable two-factor" affordance / <MFAEnrollment/> on it. The sign-in
|
|
189
|
+
* 2FA challenge is handled by <SignIn/> regardless of this flag.
|
|
190
|
+
*/
|
|
191
|
+
twoFactor: boolean;
|
|
192
|
+
/** Whether enrolled MFA is mandatory rather than optional for this project. */
|
|
193
|
+
mfaRequired: boolean;
|
|
194
|
+
/** Whether signed-in users may delete their own account. */
|
|
195
|
+
accountDeletion: boolean;
|
|
196
|
+
/** Whether organization routes and components are available for this project. */
|
|
197
|
+
organizations: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Whether inbound enterprise SSO is enabled for this project. SSO IS a sign-in
|
|
200
|
+
* method, so when true the server also pushes `'sso'` into `enabledMethods`;
|
|
201
|
+
* this flag mirrors the server capability (matching the `twoFactor`
|
|
202
|
+
* convention). <SignIn/> gates the SSO affordance on `enabledMethods`, not on
|
|
203
|
+
* this flag, so the two never drift.
|
|
204
|
+
*/
|
|
205
|
+
sso: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* JWT issuer (server contract CONTRACTS §8). Non-null only when the project's
|
|
208
|
+
* issuer toggle is on: exactly what a third-party verifier needs (Convex
|
|
209
|
+
* `auth.config.ts` = `{ type: "customJwt", issuer, jwks: jwksUrl,
|
|
210
|
+
* applicationID: aud, algorithm: "ES256" }`). The issuer remains stable when
|
|
211
|
+
* `authBaseUrl` follows a hosted or custom account-portal origin.
|
|
212
|
+
*/
|
|
213
|
+
jwtIssuer: {
|
|
214
|
+
issuer: string;
|
|
215
|
+
jwksUrl: string;
|
|
216
|
+
aud: string;
|
|
217
|
+
} | null;
|
|
218
|
+
/**
|
|
219
|
+
* The bot challenge a project has configured, provider-agnostic.
|
|
220
|
+
*
|
|
221
|
+
* Prefer this over the two Turnstile fields below, which predate provider
|
|
222
|
+
* choice and remain populated whenever the provider IS Turnstile.
|
|
223
|
+
*/
|
|
224
|
+
captcha: CaptchaConfig | null;
|
|
225
|
+
/** Public Cloudflare Turnstile site key for the phone OTP challenge. */
|
|
226
|
+
turnstileSiteKey: string | null;
|
|
227
|
+
/** Public Cloudflare Turnstile site key for protected sign-up/sign-in actions. */
|
|
228
|
+
authTurnstileSiteKey: string | null;
|
|
229
|
+
locale: string;
|
|
230
|
+
badge: boolean;
|
|
231
|
+
configVersion: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Fetch a project's public config. Publishable-key gated server-side; sent
|
|
235
|
+
* without cookies (the payload is public, so no session is needed). Throws on a
|
|
236
|
+
* non-2xx response so the caller can distinguish "config unavailable" from a
|
|
237
|
+
* project that simply has a method disabled.
|
|
238
|
+
*/
|
|
239
|
+
declare function getPublicConfig(config: ResolvedAuthConfig): Promise<PublicConfig>;
|
|
240
|
+
|
|
241
|
+
export { type EnvironmentType as E, type PublicConfig as P, getPublicConfig as g };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { R as ResolvedAuthConfig } from './config-ZhNp65dI.cjs';
|
|
2
|
+
|
|
3
|
+
type EnvironmentType = 'development' | 'production';
|
|
4
|
+
/**
|
|
5
|
+
* The public, publishable-key-safe project config the SDK renders its sign-in
|
|
6
|
+
* UI from (server contract CONTRACTS §2, `GET /api/projects/:id/public-config`).
|
|
7
|
+
* Nothing here is secret. Method slugs are canonical snake_case.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A project's configured bot challenge.
|
|
11
|
+
*
|
|
12
|
+
* `provider` is deliberately a plain string rather than a union of the ones this
|
|
13
|
+
* SDK can render. A project may be switched to a provider that predates the
|
|
14
|
+
* copy of the SDK an application is running, and the difference between
|
|
15
|
+
* "no challenge configured" and "a challenge this build cannot render" is the
|
|
16
|
+
* difference between signing in and a silent 403 the user cannot act on. Keeping
|
|
17
|
+
* the slug lets the renderer say which provider it does not know.
|
|
18
|
+
*/
|
|
19
|
+
interface CaptchaConfig {
|
|
20
|
+
provider: string;
|
|
21
|
+
siteKey: string;
|
|
22
|
+
}
|
|
23
|
+
type PublicConfig = {
|
|
24
|
+
/** Stable workspace product container shared by its environments. */
|
|
25
|
+
applicationId: string;
|
|
26
|
+
/** Stable tenant id for the exact environment selected by the publishable key. */
|
|
27
|
+
environmentId: string;
|
|
28
|
+
/** Environment class that determines key prefixes and billing treatment. */
|
|
29
|
+
environmentType: EnvironmentType;
|
|
30
|
+
/**
|
|
31
|
+
* Authentication endpoint used by this SDK instance. Hosted portals and
|
|
32
|
+
* custom domains keep this same-origin even when the stable JWT issuer uses
|
|
33
|
+
* the platform's canonical origin.
|
|
34
|
+
*/
|
|
35
|
+
authBaseUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Public acquisition mode. Optional only for rolling compatibility with
|
|
38
|
+
* servers released before waitlist support.
|
|
39
|
+
*/
|
|
40
|
+
signUp?: {
|
|
41
|
+
mode: 'open' | 'restricted' | 'allowlist' | 'waitlist';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Identity and credential lifecycle policy. Optional only for rolling
|
|
45
|
+
* compatibility with AuthOwl servers released before plan 35.
|
|
46
|
+
*/
|
|
47
|
+
authentication?: {
|
|
48
|
+
email: {
|
|
49
|
+
signUp: boolean;
|
|
50
|
+
signIn: Array<'password' | 'magic_link' | 'email_otp'>;
|
|
51
|
+
};
|
|
52
|
+
phone: {
|
|
53
|
+
signUp: boolean;
|
|
54
|
+
signIn: boolean;
|
|
55
|
+
};
|
|
56
|
+
password: {
|
|
57
|
+
signUp: boolean;
|
|
58
|
+
add: boolean;
|
|
59
|
+
/** Server-owned password length policy. Optional for rolling compatibility. */
|
|
60
|
+
minLength?: number;
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
};
|
|
63
|
+
passkey: {
|
|
64
|
+
signIn: boolean;
|
|
65
|
+
add: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The domain this environment binds passkeys to. Absent or null means the
|
|
68
|
+
* server derives it from the auth host, which is what every server before
|
|
69
|
+
* this field did - so treating both the same keeps a new SDK correct
|
|
70
|
+
* against an older server.
|
|
71
|
+
*/
|
|
72
|
+
relyingPartyId?: string | null;
|
|
73
|
+
};
|
|
74
|
+
username: {
|
|
75
|
+
collectOnSignUp: boolean;
|
|
76
|
+
signIn: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/** Email ownership ceremony selected by the project. */
|
|
80
|
+
emailVerification?: {
|
|
81
|
+
required: boolean;
|
|
82
|
+
method: 'link' | 'code';
|
|
83
|
+
};
|
|
84
|
+
/** End-user profile fields and self-service permissions. */
|
|
85
|
+
userModel?: {
|
|
86
|
+
requireEmail: boolean;
|
|
87
|
+
firstLastName: boolean;
|
|
88
|
+
emailChange: boolean;
|
|
89
|
+
accountDeletion: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* MFA presentation contract. Backup codes follow TOTP and are not an
|
|
93
|
+
* independently configurable authentication method.
|
|
94
|
+
*/
|
|
95
|
+
mfa?: {
|
|
96
|
+
totp: boolean;
|
|
97
|
+
required: boolean;
|
|
98
|
+
backupCodes: boolean;
|
|
99
|
+
/** Whether an emailed code may recover a TOTP challenge. Defaults to true for older servers. */
|
|
100
|
+
emailOtpFallback?: boolean;
|
|
101
|
+
/** Whether a successful challenge may remember this browser. Defaults to true for older servers. */
|
|
102
|
+
trustDevice?: boolean;
|
|
103
|
+
};
|
|
104
|
+
branding: {
|
|
105
|
+
appName?: string;
|
|
106
|
+
logoUrl?: string;
|
|
107
|
+
/** Whether the application name is visible beside the logo. */
|
|
108
|
+
showAppName?: boolean;
|
|
109
|
+
/** Alignment of the brand identity within managed component headers. */
|
|
110
|
+
alignment?: 'left' | 'center' | 'right';
|
|
111
|
+
primaryColor?: string;
|
|
112
|
+
theme?: 'light' | 'dark' | 'system';
|
|
113
|
+
};
|
|
114
|
+
/** Canonical method slugs, e.g. "password", "magic_link", "passkey". */
|
|
115
|
+
enabledMethods: string[];
|
|
116
|
+
/** Configured social provider ids, e.g. "google". */
|
|
117
|
+
socialProviders: string[];
|
|
118
|
+
/**
|
|
119
|
+
* Public OAuth client ids keyed by provider. Optional for rolling compatibility
|
|
120
|
+
* with servers released before Google One Tap support.
|
|
121
|
+
*/
|
|
122
|
+
socialProviderClientIds?: Record<string, string>;
|
|
123
|
+
/**
|
|
124
|
+
* When true, an email/password sign-up does not create a session - the user
|
|
125
|
+
* must confirm their address first. <SignUp/> shows a "check your email" state
|
|
126
|
+
* instead of redirecting. Always false unless password sign-up is enabled.
|
|
127
|
+
*/
|
|
128
|
+
requireEmailVerification: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Legal consent gate. When `required`, <SignUp/> shows an acceptance checkbox
|
|
131
|
+
* linking `termsUrl`/`privacyUrl` and blocks sign-up until it's checked, echoing
|
|
132
|
+
* `version` back so the server records and enforces it. `required` is true only
|
|
133
|
+
* when the project both requires consent and has a document URL to link.
|
|
134
|
+
*/
|
|
135
|
+
legal: {
|
|
136
|
+
termsUrl?: string;
|
|
137
|
+
privacyUrl?: string;
|
|
138
|
+
version: number;
|
|
139
|
+
required: boolean;
|
|
140
|
+
};
|
|
141
|
+
/** Published, bilingual privacy notices and optional consent purposes. */
|
|
142
|
+
privacy?: {
|
|
143
|
+
notices: Array<{
|
|
144
|
+
noticeId: string;
|
|
145
|
+
noticeVersionId: string;
|
|
146
|
+
code: string;
|
|
147
|
+
version: number;
|
|
148
|
+
title: {
|
|
149
|
+
en: string;
|
|
150
|
+
ar: string;
|
|
151
|
+
};
|
|
152
|
+
body: {
|
|
153
|
+
en: string;
|
|
154
|
+
ar: string;
|
|
155
|
+
};
|
|
156
|
+
digest: {
|
|
157
|
+
en: string;
|
|
158
|
+
ar: string;
|
|
159
|
+
};
|
|
160
|
+
activityCodes: string[];
|
|
161
|
+
purposeCodes: string[];
|
|
162
|
+
effectiveFrom: string;
|
|
163
|
+
}>;
|
|
164
|
+
consentPurposes: Array<{
|
|
165
|
+
purposeId: string;
|
|
166
|
+
purposeVersionId: string;
|
|
167
|
+
code: string;
|
|
168
|
+
version: number;
|
|
169
|
+
title: {
|
|
170
|
+
en: string;
|
|
171
|
+
ar: string;
|
|
172
|
+
};
|
|
173
|
+
description: {
|
|
174
|
+
en: string;
|
|
175
|
+
ar: string;
|
|
176
|
+
};
|
|
177
|
+
digest: {
|
|
178
|
+
en: string;
|
|
179
|
+
ar: string;
|
|
180
|
+
};
|
|
181
|
+
activityCodes: string[];
|
|
182
|
+
dataCategories: string[];
|
|
183
|
+
}>;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Whether the project lets signed-in users enrol a second factor (TOTP). A
|
|
187
|
+
* capability flag, not a sign-in method (so it's absent from `enabledMethods`):
|
|
188
|
+
* gate an "enable two-factor" affordance / <MFAEnrollment/> on it. The sign-in
|
|
189
|
+
* 2FA challenge is handled by <SignIn/> regardless of this flag.
|
|
190
|
+
*/
|
|
191
|
+
twoFactor: boolean;
|
|
192
|
+
/** Whether enrolled MFA is mandatory rather than optional for this project. */
|
|
193
|
+
mfaRequired: boolean;
|
|
194
|
+
/** Whether signed-in users may delete their own account. */
|
|
195
|
+
accountDeletion: boolean;
|
|
196
|
+
/** Whether organization routes and components are available for this project. */
|
|
197
|
+
organizations: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Whether inbound enterprise SSO is enabled for this project. SSO IS a sign-in
|
|
200
|
+
* method, so when true the server also pushes `'sso'` into `enabledMethods`;
|
|
201
|
+
* this flag mirrors the server capability (matching the `twoFactor`
|
|
202
|
+
* convention). <SignIn/> gates the SSO affordance on `enabledMethods`, not on
|
|
203
|
+
* this flag, so the two never drift.
|
|
204
|
+
*/
|
|
205
|
+
sso: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* JWT issuer (server contract CONTRACTS §8). Non-null only when the project's
|
|
208
|
+
* issuer toggle is on: exactly what a third-party verifier needs (Convex
|
|
209
|
+
* `auth.config.ts` = `{ type: "customJwt", issuer, jwks: jwksUrl,
|
|
210
|
+
* applicationID: aud, algorithm: "ES256" }`). The issuer remains stable when
|
|
211
|
+
* `authBaseUrl` follows a hosted or custom account-portal origin.
|
|
212
|
+
*/
|
|
213
|
+
jwtIssuer: {
|
|
214
|
+
issuer: string;
|
|
215
|
+
jwksUrl: string;
|
|
216
|
+
aud: string;
|
|
217
|
+
} | null;
|
|
218
|
+
/**
|
|
219
|
+
* The bot challenge a project has configured, provider-agnostic.
|
|
220
|
+
*
|
|
221
|
+
* Prefer this over the two Turnstile fields below, which predate provider
|
|
222
|
+
* choice and remain populated whenever the provider IS Turnstile.
|
|
223
|
+
*/
|
|
224
|
+
captcha: CaptchaConfig | null;
|
|
225
|
+
/** Public Cloudflare Turnstile site key for the phone OTP challenge. */
|
|
226
|
+
turnstileSiteKey: string | null;
|
|
227
|
+
/** Public Cloudflare Turnstile site key for protected sign-up/sign-in actions. */
|
|
228
|
+
authTurnstileSiteKey: string | null;
|
|
229
|
+
locale: string;
|
|
230
|
+
badge: boolean;
|
|
231
|
+
configVersion: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Fetch a project's public config. Publishable-key gated server-side; sent
|
|
235
|
+
* without cookies (the payload is public, so no session is needed). Throws on a
|
|
236
|
+
* non-2xx response so the caller can distinguish "config unavailable" from a
|
|
237
|
+
* project that simply has a method disabled.
|
|
238
|
+
*/
|
|
239
|
+
declare function getPublicConfig(config: ResolvedAuthConfig): Promise<PublicConfig>;
|
|
240
|
+
|
|
241
|
+
export { type EnvironmentType as E, type PublicConfig as P, getPublicConfig as g };
|