cauthy-auth 0.32.0 → 0.33.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 +22 -3
- package/dist/react.d.mts +54 -7
- package/dist/react.d.ts +54 -7
- package/dist/react.js +186 -113
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +189 -116
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ import { OrganizationMembers } from 'cauthy-auth/react'
|
|
|
90
90
|
organizationId={org.id}
|
|
91
91
|
roles={(role) => role !== 'billing'} // the roles offered when adding or changing one
|
|
92
92
|
hide={['archive', 'delete']} // never offered: 'archive', 'delete', 'rename', 'leave'
|
|
93
|
+
roleLabel={(c) => t(`roles.${c.role}`)} // a role's name wherever one shows. Default: the catalog's
|
|
93
94
|
onSaved={(e) => toast(e.kind)} // member.added, member.role_changed, member.removed, member.left,
|
|
94
95
|
/> // member.invited_again, organization.renamed, .archived, .deleted
|
|
95
96
|
|
|
@@ -173,15 +174,25 @@ The ready-made forms wear the look set for your application in Cauthy's dashboar
|
|
|
173
174
|
import 'cauthy-auth/styles.css'
|
|
174
175
|
```
|
|
175
176
|
|
|
176
|
-
Or draw them with your own `components` and `classNames`, and pass `unstyled`. Every part the forms draw can be yours; a part not given is drawn as before. With every part given and `unstyled`, the forms add
|
|
177
|
+
Or draw them with your own `components` and `classNames`, and pass `unstyled`. Every part the forms draw can be yours; a part not given is drawn as before. With every part given and `unstyled`, the forms add no element of their own but lists:
|
|
177
178
|
|
|
178
179
|
```tsx
|
|
179
|
-
<SignIn unstyled components={{ Button, Input, Checkbox, Select, Field, Text, Badge, Link, Divider, Alert, Confirm }} />
|
|
180
|
+
<SignIn unstyled components={{ Form, Button, Input, Checkbox, Select, Field, Text, Badge, Link, Divider, Alert, Confirm }} />
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
`Form` is every element the forms put around their parts: each form and each of its steps, and each part of `<Account />` and `<OrganizationMembers />`. Give it your design system's stack and the gaps between fields and buttons are yours, with no CSS on the page:
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
const Form: AuthComponents['Form'] = ({ as, children, ...rest }) =>
|
|
187
|
+
as === 'form' ? <Stack as="form" gap={3} {...rest}>{children}</Stack> : <Stack gap={3} {...rest}>{children}</Stack>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`Button` is told what kind of button it is: `primary` sends the form; `secondary` is any other way (a provider, a passkey, a sign-in link, SSO, cancel, send again); `danger` removes, leaves, deletes, disconnects, signs out everywhere or turns the second step off. `loading` is true on the one button whose action is under way; every button is `disabled` meanwhile.
|
|
191
|
+
|
|
182
192
|
| Part | Is given |
|
|
183
193
|
| --- | --- |
|
|
184
|
-
| `
|
|
194
|
+
| `Form` | `as` (`form` or `div`), `onSubmit`, `noValidate`, `aria-busy`, `className`, `section`, `children`. Render a `<form>` for `as="form"`, for Enter to send it. `section` names each part of `<Account />` (`profile`, `passkeys`… as in `AccountSection`) and of `<OrganizationMembers />` (`members`, `add-member`, `organization`, `rename`), to draw each as a card |
|
|
195
|
+
| `Button` | `type`, `variant` (`primary`, `secondary`, `danger`), `loading`, `disabled`, `className`, `onClick`, `children` |
|
|
185
196
|
| `Input` | `id`, `name`, `type`, `value`, `autoComplete`, `required`, `className`, `aria-invalid`, `aria-describedby`, `onChange(e)` |
|
|
186
197
|
| `Checkbox` | `id`, `name`, `checked`, `required`, `disabled`, `className`, `onChange(checked)`, `children` (its label) |
|
|
187
198
|
| `Select` | `id`, `name`, `value`, `options: { value, label }[]`, `disabled`, `className`, `aria-label`, `onChange(value)` |
|
|
@@ -193,6 +204,14 @@ Or draw them with your own `components` and `classNames`, and pass `unstyled`. E
|
|
|
193
204
|
| `Alert` | `tone` (`danger`, `info`, `success`), `children`. Announce it: `role="alert"` or `role="status"` |
|
|
194
205
|
| `Confirm` | A function, `({ title, body, confirmLabel, cancelLabel, danger }) => Promise<boolean>`: your own dialog before removing a member, leaving, archiving or deleting. Without it, the question shows inline |
|
|
195
206
|
|
|
207
|
+
A form checks every field before it sends anything: each one wrong shows its error at once, in the order they are drawn, and the first takes the focus. `<SignUp />` draws its fields once the workspace has said what it asks (a company's name, the legal boxes), so nothing moves as they come.
|
|
208
|
+
|
|
209
|
+
What Cauthy mails from these forms (a sign-in link, a new password, a confirmation) goes in the page's language (`<html lang>`). Give `<CauthyProvider locale>` your application's own instead, or a function for a person who can change it:
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
<CauthyProvider locale={() => i18n.language}>
|
|
213
|
+
```
|
|
214
|
+
|
|
196
215
|
`texts` changes any sentence. Its keys are stable: `email`, `password`, `name`, `code`, `signIn`, `signUp`, `continueWith`, `orWithEmail`, `forgotPassword`, `noAccount`, `createAccount`, `company`, `iAccept`, `and`, `termsOfService`, `privacyPolicy`, `haveAccount`, `sendLink`, `linkSent`, `codeHelp`, `codeHelpPhone`, `codeHelpEmail`, `sendEmailAgain`, `sendCodeSms`, `sendCodeWhatsapp`, `codeSent`, `pushSend`, `pushPick`, `pushWaiting`, `phone`, `phoneHelp`, `phoneOn`, `phoneOff`, `addPhone`, `removePhone`, `bySms`, `byWhatsapp`, `channel`, `verify`, `checkEmail`, `backToSignIn`, `emailMeALink`, `usePasskey`, `codeFromMail`, `signInLinkSent`, `newPassword`, `savePassword`, `passwordChanged`, `confirming`, `emailConfirmed`, `invitedTo`, `invitedToOrganization`, `invitedAs`, `choosePassword`, `acceptInvite`, `openingInvitation`, `invitationInvalid`, `profile`, `save`, `saved`, `currentPassword`, `changePassword`, `passwordChangedHere`, `secondStep`, `secondStepOn`, `secondStepOff`, `turnOn`, `turnOff`, `addToApp`, `openInApp`, `recoveryCodes`, `newRecoveryCodes`, `keepCodes`, `passkeys`, `managePasskeys`, `passkeysHelp`, `noPasskeys`, `passkeyName`, `addPasskey` (unused), `addPasskeyDevice`, `addSecurityKey`, `passkeyKinds`, `removePasskey`, `passkeyAdded`, `passkeyUnnamed`, `sessions`, `signOutEverywhere`, `agents`, `agentsHelp`, `disconnect`, `anAgent`, `unknownDevice`, `emailAddress`, `newEmail`, `changeEmail`, `emailSent`, `linkedAccounts`, `noLinkedAccounts`, `linkWith`, `unlink`, `linked`, `ssoOnly`, `members`, `membersHidden`, `organizationMissing`, `memberYou`, `memberInvited`, `memberManager`, `memberRole`, `memberAdd`, `memberAdded`, `memberRemove`, `memberRemoveConfirm`, `memberLeave`, `memberLeaveConfirm`, `memberInviteAgain`, `memberInvitationSent`, `organization`, `organizationRename`, `organizationRenamed`, `organizationArchive`, `organizationArchiveConfirm`, `organizationArchived`, `organizationDelete`, `organizationDeleteConfirm`, `organizationDeleted`, `yes`, `cancel`, `termsChanged`, `termsChangedHelp`, `acceptTerms`, and `errors` by error code. Built in: English and Spanish (`locale`). The dashboard can start the look from your stylesheet (shadcn/ui and Tailwind, Stackmyth, or variables of your own); `npx cauthy-auth theme --css src/app/globals.css` reads it the same way from a terminal.
|
|
197
216
|
|
|
198
217
|
Connect your application to Cauthy in one step, from Cauthy's dashboard ("Connect a System") or from a terminal. In the application's folder, `init` reads its framework (Next.js, TanStack Start, React Router or Remix, SvelteKit, Vite + React, Express, Hono, Fastify), makes the client, writes every variable to its env file, `CAUTHY_SECRET` included, and lays down the route and a sign-in page, never over a file that is there:
|
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { ComponentType, FormEvent, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/** How an application looks on Cauthy's hosted pages. Every value is optional. */
|
|
5
5
|
/** One font file the application serves: a family in one weight (or a range) and one style. */
|
|
@@ -1318,20 +1318,51 @@ interface AuthFormProps {
|
|
|
1318
1318
|
*/
|
|
1319
1319
|
workspaceLook?: boolean;
|
|
1320
1320
|
/**
|
|
1321
|
-
* The application's own parts, to draw the form with: its
|
|
1322
|
-
* checkbox, select, field, text, badge, link, divider, alert
|
|
1323
|
-
* confirmation. A part not given is drawn as before; with every part given
|
|
1321
|
+
* The application's own parts, to draw the form with: its form layout,
|
|
1322
|
+
* button, input, checkbox, select, field, text, badge, link, divider, alert
|
|
1323
|
+
* and confirmation. A part not given is drawn as before; with every part given
|
|
1324
1324
|
* and `unstyled`, the form adds no element that carries a look of its own.
|
|
1325
1325
|
*/
|
|
1326
1326
|
components?: AuthComponents;
|
|
1327
1327
|
}
|
|
1328
|
-
/**
|
|
1328
|
+
/**
|
|
1329
|
+
* What the application's button is given: what a `<button>` would be, and
|
|
1330
|
+
* what kind of button it is. `primary` sends the form; `secondary` is any
|
|
1331
|
+
* other action (a provider, a passkey, a sign-in link, cancel, send again);
|
|
1332
|
+
* `danger` removes, leaves, deletes, disconnects or turns something off.
|
|
1333
|
+
* `loading` is true on the one button whose action is under way; every
|
|
1334
|
+
* button is `disabled` meanwhile, as before.
|
|
1335
|
+
*/
|
|
1329
1336
|
interface AuthButtonProps {
|
|
1330
1337
|
type: 'submit' | 'button';
|
|
1331
1338
|
disabled?: boolean;
|
|
1332
1339
|
className?: string;
|
|
1333
1340
|
onClick?: () => void;
|
|
1334
1341
|
children: ReactNode;
|
|
1342
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
1343
|
+
loading?: boolean;
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* What the application's form layout is given: every element the forms put
|
|
1347
|
+
* around their parts — a whole form, each step of it, each part of the
|
|
1348
|
+
* account and members screens — so its own stack lays them out. `as` says
|
|
1349
|
+
* which element it stands for: a `form` sends with `onSubmit` (render a
|
|
1350
|
+
* `<form>` with it for Enter to submit), a `div` only groups.
|
|
1351
|
+
*/
|
|
1352
|
+
interface AuthFormLayoutProps {
|
|
1353
|
+
as: 'form' | 'div';
|
|
1354
|
+
onSubmit?: (e: FormEvent) => void;
|
|
1355
|
+
noValidate?: boolean;
|
|
1356
|
+
'aria-busy'?: boolean;
|
|
1357
|
+
className?: string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Which part of `<Account />` or `<OrganizationMembers />` this is, for an
|
|
1360
|
+
* application that draws each as a card: an `AccountSection`
|
|
1361
|
+
* (`profile`, `passkeys`…), or `members`, `add-member`, `organization`
|
|
1362
|
+
* and `rename` (the form inside `organization`). Not set on a whole form.
|
|
1363
|
+
*/
|
|
1364
|
+
section?: string;
|
|
1365
|
+
children: ReactNode;
|
|
1335
1366
|
}
|
|
1336
1367
|
/** What the application's input is given: what an `<input>` would be. */
|
|
1337
1368
|
interface AuthInputProps {
|
|
@@ -1434,6 +1465,12 @@ interface AuthConfirmOptions {
|
|
|
1434
1465
|
}
|
|
1435
1466
|
/** The parts a form may be drawn with. See `AuthFormProps.components`. */
|
|
1436
1467
|
interface AuthComponents {
|
|
1468
|
+
/**
|
|
1469
|
+
* Every element around the form's parts: the form itself, each step, each
|
|
1470
|
+
* part of the account and members screens. Not given: the `form`, `div` or
|
|
1471
|
+
* `section` the forms have always drawn.
|
|
1472
|
+
*/
|
|
1473
|
+
Form?: ComponentType<AuthFormLayoutProps>;
|
|
1437
1474
|
Button?: ComponentType<AuthButtonProps>;
|
|
1438
1475
|
Input?: ComponentType<AuthInputProps>;
|
|
1439
1476
|
Checkbox?: ComponentType<AuthCheckboxProps>;
|
|
@@ -1639,6 +1676,8 @@ interface OrganizationMembersProps extends Omit<AuthFormProps, 'links' | 'return
|
|
|
1639
1676
|
roles?: (role: string, choice: OrganizationRoleChoice) => boolean;
|
|
1640
1677
|
/** Actions never offered, whatever the person's role allows. */
|
|
1641
1678
|
hide?: OrganizationMembersAction[];
|
|
1679
|
+
/** A role's name wherever one shows: a member's, the role choices, adding one. Default: the name the catalog gives it. */
|
|
1680
|
+
roleLabel?: (choice: OrganizationRoleChoice) => string;
|
|
1642
1681
|
/** Called after every change saved, with what changed. */
|
|
1643
1682
|
onSaved?: (event: OrganizationMembersEvent) => void;
|
|
1644
1683
|
}
|
|
@@ -1684,8 +1723,16 @@ interface CauthyProviderProps {
|
|
|
1684
1723
|
* out when the server did not look.
|
|
1685
1724
|
*/
|
|
1686
1725
|
initialSession?: PublicSession | null;
|
|
1726
|
+
/**
|
|
1727
|
+
* The language the person reads, for what Cauthy mails them from
|
|
1728
|
+
* `useAuth()` and the ready-made forms (a sign-in link, a new password, a
|
|
1729
|
+
* confirmation): a tag like `es` or `es-CO`, or a function that answers it
|
|
1730
|
+
* when the person can change it. Default: the page's own (`<html lang>`),
|
|
1731
|
+
* else the browser's.
|
|
1732
|
+
*/
|
|
1733
|
+
locale?: string | (() => string | undefined);
|
|
1687
1734
|
}
|
|
1688
|
-
declare function CauthyProvider({ children, basePath, initialSession }: CauthyProviderProps): react.JSX.Element;
|
|
1735
|
+
declare function CauthyProvider({ children, basePath, initialSession, locale }: CauthyProviderProps): react.JSX.Element;
|
|
1689
1736
|
declare function useSession(): SessionContext;
|
|
1690
1737
|
/**
|
|
1691
1738
|
* The application's own sign-in screens: the functions a form calls.
|
|
@@ -1698,4 +1745,4 @@ declare function useSession(): SessionContext;
|
|
|
1698
1745
|
*/
|
|
1699
1746
|
declare function useAuth(): AuthClient & Pick<SessionContext, 'session' | 'status' | 'refresh'>;
|
|
1700
1747
|
|
|
1701
|
-
export { AcceptInvite, type AcceptInviteEvent, type AcceptInviteProps, Account, AccountAgents, type AccountClient, type Account$1 as AccountDetails, AccountEmail, type AccountEvent, AccountLinked, type AccountPartProps, AccountPasskeys, AccountPassword, AccountPhone, AccountProfile, type AccountProps, AccountSecondStep, type AccountSection, type AccountSession, AccountSessions, type AuthAlertProps, type AuthBadgeProps, type AuthButtonProps, type AuthCheckboxProps, type AuthClient, type AuthComponents, type AuthConfirmOptions, type AuthDividerProps, type AuthError, type AuthFieldProps, type AuthFormProps, type AuthInputProps, type AuthLinkProps, type AuthMethods, type AuthResult, type AuthSelectProps, type AuthTextProps, type AuthTexts, CauthyProvider, type CauthyProviderProps, type ConnectedAgent, ForgotPassword, GoogleOneTap, type GoogleOneTapProps, type Invitation, type JsonValue, type LinkedIdentity, OrganizationMembers, type OrganizationMembersAction, type OrganizationMembersEvent, type OrganizationMembersProps, type OrganizationPerson, type OrganizationRoleChoice, type OrganizationSeat, type OrganizationsClient, type Passkey, type PasskeyKind, type PendingLegal, PendingTerms, type PendingTermsProps, type PermissionOf, type Policy, type PublicSession, ResetPassword, type RoleOf, type SSOConnection, type SecondStep, type SessionContext, type SessionOrganization, type SessionUser, SignIn, SignUp, VerifyEmail, can, canAutofillPasskeys, canUsePasskeys, createAuthClient, definePolicy, useAuth, useSession };
|
|
1748
|
+
export { AcceptInvite, type AcceptInviteEvent, type AcceptInviteProps, Account, AccountAgents, type AccountClient, type Account$1 as AccountDetails, AccountEmail, type AccountEvent, AccountLinked, type AccountPartProps, AccountPasskeys, AccountPassword, AccountPhone, AccountProfile, type AccountProps, AccountSecondStep, type AccountSection, type AccountSession, AccountSessions, type AuthAlertProps, type AuthBadgeProps, type AuthButtonProps, type AuthCheckboxProps, type AuthClient, type AuthComponents, type AuthConfirmOptions, type AuthDividerProps, type AuthError, type AuthFieldProps, type AuthFormLayoutProps, type AuthFormProps, type AuthInputProps, type AuthLinkProps, type AuthMethods, type AuthResult, type AuthSelectProps, type AuthTextProps, type AuthTexts, CauthyProvider, type CauthyProviderProps, type ConnectedAgent, ForgotPassword, GoogleOneTap, type GoogleOneTapProps, type Invitation, type JsonValue, type LinkedIdentity, OrganizationMembers, type OrganizationMembersAction, type OrganizationMembersEvent, type OrganizationMembersProps, type OrganizationPerson, type OrganizationRoleChoice, type OrganizationSeat, type OrganizationsClient, type Passkey, type PasskeyKind, type PendingLegal, PendingTerms, type PendingTermsProps, type PermissionOf, type Policy, type PublicSession, ResetPassword, type RoleOf, type SSOConnection, type SecondStep, type SessionContext, type SessionOrganization, type SessionUser, SignIn, SignUp, VerifyEmail, can, canAutofillPasskeys, canUsePasskeys, createAuthClient, definePolicy, useAuth, useSession };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { ComponentType, FormEvent, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/** How an application looks on Cauthy's hosted pages. Every value is optional. */
|
|
5
5
|
/** One font file the application serves: a family in one weight (or a range) and one style. */
|
|
@@ -1318,20 +1318,51 @@ interface AuthFormProps {
|
|
|
1318
1318
|
*/
|
|
1319
1319
|
workspaceLook?: boolean;
|
|
1320
1320
|
/**
|
|
1321
|
-
* The application's own parts, to draw the form with: its
|
|
1322
|
-
* checkbox, select, field, text, badge, link, divider, alert
|
|
1323
|
-
* confirmation. A part not given is drawn as before; with every part given
|
|
1321
|
+
* The application's own parts, to draw the form with: its form layout,
|
|
1322
|
+
* button, input, checkbox, select, field, text, badge, link, divider, alert
|
|
1323
|
+
* and confirmation. A part not given is drawn as before; with every part given
|
|
1324
1324
|
* and `unstyled`, the form adds no element that carries a look of its own.
|
|
1325
1325
|
*/
|
|
1326
1326
|
components?: AuthComponents;
|
|
1327
1327
|
}
|
|
1328
|
-
/**
|
|
1328
|
+
/**
|
|
1329
|
+
* What the application's button is given: what a `<button>` would be, and
|
|
1330
|
+
* what kind of button it is. `primary` sends the form; `secondary` is any
|
|
1331
|
+
* other action (a provider, a passkey, a sign-in link, cancel, send again);
|
|
1332
|
+
* `danger` removes, leaves, deletes, disconnects or turns something off.
|
|
1333
|
+
* `loading` is true on the one button whose action is under way; every
|
|
1334
|
+
* button is `disabled` meanwhile, as before.
|
|
1335
|
+
*/
|
|
1329
1336
|
interface AuthButtonProps {
|
|
1330
1337
|
type: 'submit' | 'button';
|
|
1331
1338
|
disabled?: boolean;
|
|
1332
1339
|
className?: string;
|
|
1333
1340
|
onClick?: () => void;
|
|
1334
1341
|
children: ReactNode;
|
|
1342
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
1343
|
+
loading?: boolean;
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* What the application's form layout is given: every element the forms put
|
|
1347
|
+
* around their parts — a whole form, each step of it, each part of the
|
|
1348
|
+
* account and members screens — so its own stack lays them out. `as` says
|
|
1349
|
+
* which element it stands for: a `form` sends with `onSubmit` (render a
|
|
1350
|
+
* `<form>` with it for Enter to submit), a `div` only groups.
|
|
1351
|
+
*/
|
|
1352
|
+
interface AuthFormLayoutProps {
|
|
1353
|
+
as: 'form' | 'div';
|
|
1354
|
+
onSubmit?: (e: FormEvent) => void;
|
|
1355
|
+
noValidate?: boolean;
|
|
1356
|
+
'aria-busy'?: boolean;
|
|
1357
|
+
className?: string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Which part of `<Account />` or `<OrganizationMembers />` this is, for an
|
|
1360
|
+
* application that draws each as a card: an `AccountSection`
|
|
1361
|
+
* (`profile`, `passkeys`…), or `members`, `add-member`, `organization`
|
|
1362
|
+
* and `rename` (the form inside `organization`). Not set on a whole form.
|
|
1363
|
+
*/
|
|
1364
|
+
section?: string;
|
|
1365
|
+
children: ReactNode;
|
|
1335
1366
|
}
|
|
1336
1367
|
/** What the application's input is given: what an `<input>` would be. */
|
|
1337
1368
|
interface AuthInputProps {
|
|
@@ -1434,6 +1465,12 @@ interface AuthConfirmOptions {
|
|
|
1434
1465
|
}
|
|
1435
1466
|
/** The parts a form may be drawn with. See `AuthFormProps.components`. */
|
|
1436
1467
|
interface AuthComponents {
|
|
1468
|
+
/**
|
|
1469
|
+
* Every element around the form's parts: the form itself, each step, each
|
|
1470
|
+
* part of the account and members screens. Not given: the `form`, `div` or
|
|
1471
|
+
* `section` the forms have always drawn.
|
|
1472
|
+
*/
|
|
1473
|
+
Form?: ComponentType<AuthFormLayoutProps>;
|
|
1437
1474
|
Button?: ComponentType<AuthButtonProps>;
|
|
1438
1475
|
Input?: ComponentType<AuthInputProps>;
|
|
1439
1476
|
Checkbox?: ComponentType<AuthCheckboxProps>;
|
|
@@ -1639,6 +1676,8 @@ interface OrganizationMembersProps extends Omit<AuthFormProps, 'links' | 'return
|
|
|
1639
1676
|
roles?: (role: string, choice: OrganizationRoleChoice) => boolean;
|
|
1640
1677
|
/** Actions never offered, whatever the person's role allows. */
|
|
1641
1678
|
hide?: OrganizationMembersAction[];
|
|
1679
|
+
/** A role's name wherever one shows: a member's, the role choices, adding one. Default: the name the catalog gives it. */
|
|
1680
|
+
roleLabel?: (choice: OrganizationRoleChoice) => string;
|
|
1642
1681
|
/** Called after every change saved, with what changed. */
|
|
1643
1682
|
onSaved?: (event: OrganizationMembersEvent) => void;
|
|
1644
1683
|
}
|
|
@@ -1684,8 +1723,16 @@ interface CauthyProviderProps {
|
|
|
1684
1723
|
* out when the server did not look.
|
|
1685
1724
|
*/
|
|
1686
1725
|
initialSession?: PublicSession | null;
|
|
1726
|
+
/**
|
|
1727
|
+
* The language the person reads, for what Cauthy mails them from
|
|
1728
|
+
* `useAuth()` and the ready-made forms (a sign-in link, a new password, a
|
|
1729
|
+
* confirmation): a tag like `es` or `es-CO`, or a function that answers it
|
|
1730
|
+
* when the person can change it. Default: the page's own (`<html lang>`),
|
|
1731
|
+
* else the browser's.
|
|
1732
|
+
*/
|
|
1733
|
+
locale?: string | (() => string | undefined);
|
|
1687
1734
|
}
|
|
1688
|
-
declare function CauthyProvider({ children, basePath, initialSession }: CauthyProviderProps): react.JSX.Element;
|
|
1735
|
+
declare function CauthyProvider({ children, basePath, initialSession, locale }: CauthyProviderProps): react.JSX.Element;
|
|
1689
1736
|
declare function useSession(): SessionContext;
|
|
1690
1737
|
/**
|
|
1691
1738
|
* The application's own sign-in screens: the functions a form calls.
|
|
@@ -1698,4 +1745,4 @@ declare function useSession(): SessionContext;
|
|
|
1698
1745
|
*/
|
|
1699
1746
|
declare function useAuth(): AuthClient & Pick<SessionContext, 'session' | 'status' | 'refresh'>;
|
|
1700
1747
|
|
|
1701
|
-
export { AcceptInvite, type AcceptInviteEvent, type AcceptInviteProps, Account, AccountAgents, type AccountClient, type Account$1 as AccountDetails, AccountEmail, type AccountEvent, AccountLinked, type AccountPartProps, AccountPasskeys, AccountPassword, AccountPhone, AccountProfile, type AccountProps, AccountSecondStep, type AccountSection, type AccountSession, AccountSessions, type AuthAlertProps, type AuthBadgeProps, type AuthButtonProps, type AuthCheckboxProps, type AuthClient, type AuthComponents, type AuthConfirmOptions, type AuthDividerProps, type AuthError, type AuthFieldProps, type AuthFormProps, type AuthInputProps, type AuthLinkProps, type AuthMethods, type AuthResult, type AuthSelectProps, type AuthTextProps, type AuthTexts, CauthyProvider, type CauthyProviderProps, type ConnectedAgent, ForgotPassword, GoogleOneTap, type GoogleOneTapProps, type Invitation, type JsonValue, type LinkedIdentity, OrganizationMembers, type OrganizationMembersAction, type OrganizationMembersEvent, type OrganizationMembersProps, type OrganizationPerson, type OrganizationRoleChoice, type OrganizationSeat, type OrganizationsClient, type Passkey, type PasskeyKind, type PendingLegal, PendingTerms, type PendingTermsProps, type PermissionOf, type Policy, type PublicSession, ResetPassword, type RoleOf, type SSOConnection, type SecondStep, type SessionContext, type SessionOrganization, type SessionUser, SignIn, SignUp, VerifyEmail, can, canAutofillPasskeys, canUsePasskeys, createAuthClient, definePolicy, useAuth, useSession };
|
|
1748
|
+
export { AcceptInvite, type AcceptInviteEvent, type AcceptInviteProps, Account, AccountAgents, type AccountClient, type Account$1 as AccountDetails, AccountEmail, type AccountEvent, AccountLinked, type AccountPartProps, AccountPasskeys, AccountPassword, AccountPhone, AccountProfile, type AccountProps, AccountSecondStep, type AccountSection, type AccountSession, AccountSessions, type AuthAlertProps, type AuthBadgeProps, type AuthButtonProps, type AuthCheckboxProps, type AuthClient, type AuthComponents, type AuthConfirmOptions, type AuthDividerProps, type AuthError, type AuthFieldProps, type AuthFormLayoutProps, type AuthFormProps, type AuthInputProps, type AuthLinkProps, type AuthMethods, type AuthResult, type AuthSelectProps, type AuthTextProps, type AuthTexts, CauthyProvider, type CauthyProviderProps, type ConnectedAgent, ForgotPassword, GoogleOneTap, type GoogleOneTapProps, type Invitation, type JsonValue, type LinkedIdentity, OrganizationMembers, type OrganizationMembersAction, type OrganizationMembersEvent, type OrganizationMembersProps, type OrganizationPerson, type OrganizationRoleChoice, type OrganizationSeat, type OrganizationsClient, type Passkey, type PasskeyKind, type PendingLegal, PendingTerms, type PendingTermsProps, type PermissionOf, type Policy, type PublicSession, ResetPassword, type RoleOf, type SSOConnection, type SecondStep, type SessionContext, type SessionOrganization, type SessionUser, SignIn, SignUp, VerifyEmail, can, canAutofillPasskeys, canUsePasskeys, createAuthClient, definePolicy, useAuth, useSession };
|