cauthy-auth 0.36.1 → 0.37.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 +6 -2
- package/dist/react.d.mts +12 -0
- package/dist/react.d.ts +12 -0
- package/dist/react.js +277 -45
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +277 -45
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,6 +76,8 @@ import { Account, AccountPasskeys } from 'cauthy-auth/react'
|
|
|
76
76
|
|
|
77
77
|
`sections` lists the parts shown, in that order: `profile`, `email`, `password`, `linked`, `secondStep`, `phone`, `passkeys`, `agents`, `sessions` (default: all). Each is also its own component: `AccountProfile`, `AccountEmail`, `AccountPassword`, `AccountLinked`, `AccountSecondStep`, `AccountPhone`, `AccountPasskeys`, `AccountAgents`, `AccountSessions`. `onSaved` is called after every change saved, with `{ kind, ... }`: `profile.saved`, `email.change_requested`, `password.changed`, `identity.linked`, `identity.unlinked`, `mfa.enabled`, `mfa.disabled`, `recovery_codes.regenerated`, `phone.added`, `phone.removed`, `passkey.added`, `passkey.removed`, `agent.disconnected`, `sessions.ended`.
|
|
78
78
|
|
|
79
|
+
Each part shows a form only while what it sets up has nothing set yet: no second step, no phone, no passkey, no name. Once something is set, the part shows it (the name and address, "Your account has a password", the second step on, the masked phone and its channel, the passkeys with their kind and date) with its actions: "Change", "Change email", "Change password", "Turn off", "New recovery codes", "Remove phone", "Add a passkey". The form opens only when one is pressed, with a "Cancel" back; an action that weakens the account asks for the current password there, and runs at once for an account without one. Recovery codes, when made, are listed as text to select, with "Copy all" (to the clipboard, one per line) and "Download .txt" (`recovery-codes.txt`). They go nowhere else: no log, no browser storage.
|
|
80
|
+
|
|
79
81
|
The legal documents a signed-in person still owes (a new version of the terms), with the action that accepts them. It shows nothing when nothing is owed:
|
|
80
82
|
|
|
81
83
|
```tsx
|
|
@@ -106,6 +108,8 @@ await organizations.archive(org.id) // only the workspace restores
|
|
|
106
108
|
await organizations.delete(org.id) // for good
|
|
107
109
|
```
|
|
108
110
|
|
|
111
|
+
`<OrganizationMembers />` follows the same rule: the form to add a member shows as it is while nobody but the person belongs; once others do, it opens on "Add member", with "Cancel". The organization's name shows with "Rename", which opens its form.
|
|
112
|
+
|
|
109
113
|
| Reserved power | Lets a member |
|
|
110
114
|
| --- | --- |
|
|
111
115
|
| `cauthy:members:read` | see the people (`can.readMembers`) |
|
|
@@ -201,7 +205,7 @@ The forms stay busy from the press until the work is really over. A sign-in that
|
|
|
201
205
|
|
|
202
206
|
| Part | Is given |
|
|
203
207
|
| --- | --- |
|
|
204
|
-
| `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 |
|
|
208
|
+
| `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. A part that shows what is set, with its actions, is a `div`; it is a `form` once its form is open |
|
|
205
209
|
| `Button` | `type`, `variant` (`primary`, `secondary`, `danger`), `loading`, `disabled`, `className`, `onClick`, `children` |
|
|
206
210
|
| `Input` | `id`, `name`, `type`, `value`, `autoComplete`, `required`, `disabled`, `className`, `aria-invalid`, `aria-describedby`, `onChange(e)` |
|
|
207
211
|
| `Checkbox` | `id`, `name`, `checked`, `required`, `disabled`, `className`, `onChange(checked)`, `children` (its label) |
|
|
@@ -222,7 +226,7 @@ What Cauthy mails from these forms (a sign-in link, a new password, a confirmati
|
|
|
222
226
|
<CauthyProvider locale={() => i18n.language}>
|
|
223
227
|
```
|
|
224
228
|
|
|
225
|
-
`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`, `linkHelp`, `sendMeTheLink`, `back`, `usePasskey`, `codeFromMail`, `signInLinkSent`, `newPassword`, `savePassword`, `passwordChanged`, `confirming`, `loading`, `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.
|
|
229
|
+
`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`, `linkHelp`, `sendMeTheLink`, `back`, `usePasskey`, `codeFromMail`, `signInLinkSent`, `newPassword`, `savePassword`, `passwordChanged`, `confirming`, `loading`, `emailConfirmed`, `invitedTo`, `invitedToOrganization`, `invitedAs`, `choosePassword`, `acceptInvite`, `openingInvitation`, `invitationInvalid`, `profile`, `save`, `saved`, `currentPassword`, `changePassword`, `passwordChangedHere`, `secondStep`, `secondStepOn`, `secondStepOff`, `turnOn`, `turnOff`, `addToApp`, `openInApp`, `recoveryCodes`, `newRecoveryCodes`, `keepCodes`, `copyCodes`, `downloadCodes`, `codesCopied`, `codesNotCopied`, `change`, `passwordSet`, `addAnotherPasskey`, `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.
|
|
226
230
|
|
|
227
231
|
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:
|
|
228
232
|
|
package/dist/react.d.mts
CHANGED
|
@@ -1225,6 +1225,18 @@ interface AuthTexts {
|
|
|
1225
1225
|
recoveryCodes: string;
|
|
1226
1226
|
newRecoveryCodes: string;
|
|
1227
1227
|
keepCodes: string;
|
|
1228
|
+
/** Beside recovery codes just made: copy them all, or save them as a text file. */
|
|
1229
|
+
copyCodes: string;
|
|
1230
|
+
downloadCodes: string;
|
|
1231
|
+
codesCopied: string;
|
|
1232
|
+
/** Said when the browser would not copy: the codes stay on screen to select. */
|
|
1233
|
+
codesNotCopied: string;
|
|
1234
|
+
/** The action that opens the form of a part already set (the name). */
|
|
1235
|
+
change: string;
|
|
1236
|
+
/** The password part, when the account has one. */
|
|
1237
|
+
passwordSet: string;
|
|
1238
|
+
/** Opens the form that adds another passkey, once the account has one. */
|
|
1239
|
+
addAnotherPasskey: string;
|
|
1228
1240
|
passkeys: string;
|
|
1229
1241
|
managePasskeys: string;
|
|
1230
1242
|
passkeysHelp: string;
|
package/dist/react.d.ts
CHANGED
|
@@ -1225,6 +1225,18 @@ interface AuthTexts {
|
|
|
1225
1225
|
recoveryCodes: string;
|
|
1226
1226
|
newRecoveryCodes: string;
|
|
1227
1227
|
keepCodes: string;
|
|
1228
|
+
/** Beside recovery codes just made: copy them all, or save them as a text file. */
|
|
1229
|
+
copyCodes: string;
|
|
1230
|
+
downloadCodes: string;
|
|
1231
|
+
codesCopied: string;
|
|
1232
|
+
/** Said when the browser would not copy: the codes stay on screen to select. */
|
|
1233
|
+
codesNotCopied: string;
|
|
1234
|
+
/** The action that opens the form of a part already set (the name). */
|
|
1235
|
+
change: string;
|
|
1236
|
+
/** The password part, when the account has one. */
|
|
1237
|
+
passwordSet: string;
|
|
1238
|
+
/** Opens the form that adds another passkey, once the account has one. */
|
|
1239
|
+
addAnotherPasskey: string;
|
|
1228
1240
|
passkeys: string;
|
|
1229
1241
|
managePasskeys: string;
|
|
1230
1242
|
passkeysHelp: string;
|