@aiveth/react 0.13.0 → 0.15.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/CHANGELOG.md +10 -1
- package/README.md +8 -0
- package/dist/box.js +31 -3
- package/dist/here.d.ts +28 -1
- package/dist/here.js +38 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.15.0 — unreleased
|
|
4
|
+
|
|
5
|
+
- A new device (Aiveth's Client Trust: a right password from a device the person hasn't used to sign in before, on an account without two-step): `needs_device_code`. `sendDeviceCode()` emails the code, `verifyDeviceCode(code)` signs in. `<SignIn />` sends the code at once and shows the step. This browser keeps the device's token for the app (in `localStorage`) and sends it with each sign-in, so the code is asked once per device.
|
|
6
|
+
|
|
7
|
+
## 0.14.0 — 2026-11-30
|
|
8
|
+
|
|
9
|
+
- The steps after the password, on your page (Clerk's session tasks): where your organization requires two-step, `needs_two_step_setup` shows the QR code and its key (`twoStepSetup()` for it again, `verifyTwoStepSetup(code)`), then `needs_recovery_codes_saved` shows the recovery codes once with their file (`recoveryCodesSaved()`). Where your app requires a workspace and the person is in several, `needs_workspace` lists them (`chooseWorkspace(id)`). `<SignIn />` shows all three; before, they went to Aiveth's page.
|
|
10
|
+
- `<SignIn />` no longer stretches to the height of a flex parent.
|
|
11
|
+
|
|
12
|
+
## 0.13.0 — 2026-11-30
|
|
4
13
|
|
|
5
14
|
- `<SignIn />` and `<SignUp />`: a ready-made sign-in box for your own page. One line, and it runs every step of `signInHere` — address, password, email code, Google / Microsoft / GitHub / SSO, second factor, a new password, sign-up details, your organization's terms — in your organization's look and the person's language (the sign-in card's own translations; `locale` to choose). `invitation` opens an invitation link's token. A step only Aiveth's page can do goes there and comes back. "Secured by Aiveth" shows on Free and Pro only. `signInHere.settings()` returns what the box reads.
|
|
6
15
|
- An email code sent during a sign-in now answers `needs_email_code`.
|
package/README.md
CHANGED
|
@@ -63,6 +63,14 @@ Also `signInHere.signUp({ email })` (`verifySignUpCode`, `details`), `signInHere
|
|
|
63
63
|
(`details`), and on a sign-in `sendResetCode` / `verifyResetCode` / `setNewPassword` and
|
|
64
64
|
`acceptTerms`. A refused step throws `StepRefused` with its HTTP `status` (401, 422, 429, 404).
|
|
65
65
|
|
|
66
|
+
After the password, two more steps can come: `needs_two_step_setup` where your organization
|
|
67
|
+
requires two-step (`step.qr`, `step.secret`; `verifyTwoStepSetup(code)`, then
|
|
68
|
+
`needs_recovery_codes_saved` with `step.recoveryCodes` shown once and `recoveryCodesSaved()`), and
|
|
69
|
+
`needs_workspace` where your app requires a workspace (`step.workspaces`; `chooseWorkspace(id)`).
|
|
70
|
+
A right password from a device the person hasn't used before answers `needs_device_code`:
|
|
71
|
+
`sendDeviceCode()`, then `verifyDeviceCode(code)`. The browser keeps the device's token for your app,
|
|
72
|
+
so the code is asked once per device.
|
|
73
|
+
|
|
66
74
|
## A ready-made sign-in box
|
|
67
75
|
|
|
68
76
|
`<SignIn />` runs every step above in your organization's look (Aiveth → Branding) and the person's
|
package/dist/box.js
CHANGED
|
@@ -31,6 +31,13 @@ function sayAround(words, text, slot, node, values = {}) {
|
|
|
31
31
|
const [before, after = ''] = say(words, text, { ...values, [slot]: '\u0000' }).split('\u0000');
|
|
32
32
|
return _jsxs(_Fragment, { children: [before, node, after] });
|
|
33
33
|
}
|
|
34
|
+
/** The recovery codes as the file Aiveth's own page offers (its name and text from Aiveth). */
|
|
35
|
+
function download(name, contents) {
|
|
36
|
+
const url = URL.createObjectURL(new Blob([contents], { type: 'text/plain;charset=utf-8' }));
|
|
37
|
+
const a = Object.assign(document.createElement('a'), { href: url, download: name });
|
|
38
|
+
a.click();
|
|
39
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
40
|
+
}
|
|
34
41
|
function inviteFromAddress() {
|
|
35
42
|
if (typeof window === 'undefined')
|
|
36
43
|
return '';
|
|
@@ -72,6 +79,9 @@ export function SignInBox({ setup, mode, locale, invitation, className, style })
|
|
|
72
79
|
setAsSignUp(false); // an account already: its sign-in
|
|
73
80
|
if (next.email)
|
|
74
81
|
setEmail(next.email);
|
|
82
|
+
// A new device: the code goes out at once — the step asks for it (Clerk's prepare step).
|
|
83
|
+
if (next.status === 'needs_device_code' && step?.status !== 'needs_device_code')
|
|
84
|
+
void flow.current?.sendDeviceCode().catch(() => undefined);
|
|
75
85
|
setStep(next);
|
|
76
86
|
}
|
|
77
87
|
catch (e) {
|
|
@@ -97,7 +107,7 @@ export function SignInBox({ setup, mode, locale, invitation, className, style })
|
|
|
97
107
|
const outlined = settings.look.button_style === 'outlined';
|
|
98
108
|
const font = settings.look.font?.family;
|
|
99
109
|
const s = {
|
|
100
|
-
card: { boxSizing: 'border-box', width: '100%', maxWidth: 400, padding: 28, background: c.card, color: c.text, border: `1px solid ${c.border}`, borderRadius: radius + 4, fontFamily: font ? `'${font}', system-ui, sans-serif` : 'system-ui, sans-serif', ...style },
|
|
110
|
+
card: { boxSizing: 'border-box', width: '100%', maxWidth: 400, height: 'fit-content', padding: 28, background: c.card, color: c.text, border: `1px solid ${c.border}`, borderRadius: radius + 4, fontFamily: font ? `'${font}', system-ui, sans-serif` : 'system-ui, sans-serif', ...style },
|
|
101
111
|
title: { margin: '0 0 16px', fontSize: 20, fontWeight: 600, textAlign: 'center' },
|
|
102
112
|
label: { display: 'block', fontSize: 14, fontWeight: 500, margin: '12px 0 6px' },
|
|
103
113
|
input: { boxSizing: 'border-box', width: '100%', minHeight: 44, padding: '0 12px', background: c.input, color: c.text, border: `1px solid ${c.border}`, borderRadius: radius, fontSize: 16, fontFamily: 'inherit' },
|
|
@@ -128,6 +138,9 @@ export function SignInBox({ setup, mode, locale, invitation, className, style })
|
|
|
128
138
|
const ways = step.ways ?? [];
|
|
129
139
|
body = (_jsxs(_Fragment, { children: [who, ways.includes('password') && (_jsxs("form", { onSubmit: submit((f) => flow.current.password(text(f, 'password'))), children: [field('password', say(w, 'Password'), { type: 'password', autoComplete: 'current-password', autoFocus: true }), _jsx("p", { style: { ...s.note, textAlign: 'end' }, children: _jsx("button", { type: "button", style: s.link, onClick: () => void run(() => flow.current.sendResetCode()), children: say(w, 'Forgot password?') }) }), _jsx("button", { type: "submit", style: s.button, disabled: busy, children: say(w, 'Continue') })] })), ways.includes('email_code') && _jsx("button", { type: "button", style: s.quiet, disabled: busy, onClick: () => void run(() => flow.current.sendEmailCode()), children: say(w, 'Email me a code') }), ways.filter((x) => PROVIDERS[x]).map((x) => (_jsx("button", { type: "button", style: s.quiet, onClick: () => setup.withProvider(x, email), children: say(w, 'Continue with {name}', { name: PROVIDERS[x] ?? x }) }, x))), ways.includes('sso') && _jsx("button", { type: "button", style: s.quiet, onClick: () => setup.withProvider('sso', email), children: say(w, 'Single sign-on (SSO)') })] }));
|
|
130
140
|
}
|
|
141
|
+
else if (status === 'needs_device_code') {
|
|
142
|
+
body = (_jsxs("form", { onSubmit: submit((f) => flow.current.verifyDeviceCode(text(f, 'code'))), children: [_jsx("p", { style: s.note, children: say(w, "You're signing in on a new device. To make sure it's you, enter the code we emailed.") }), _jsx("p", { style: s.note, children: say(w, 'We sent a code to {email}. It ends in 10 minutes.', { email }) }), field('code', say(w, '8-digit code'), { inputMode: 'numeric', autoComplete: 'one-time-code', autoFocus: true }), _jsx("button", { type: "submit", style: s.button, disabled: busy, children: say(w, 'Continue') }), _jsx("button", { type: "button", style: s.quiet, disabled: busy, onClick: () => void run(() => flow.current.sendDeviceCode()), children: say(w, 'Send the code again') })] }));
|
|
143
|
+
}
|
|
131
144
|
else if (status === 'needs_email_code' || status === 'needs_reset_code') {
|
|
132
145
|
const signUp = asSignUp && status === 'needs_email_code';
|
|
133
146
|
body = (_jsxs("form", { onSubmit: submit((f) => {
|
|
@@ -150,6 +163,17 @@ export function SignInBox({ setup, mode, locale, invitation, className, style })
|
|
|
150
163
|
const links = [[step.termsUrl, 'Terms of Service'], [step.privacyUrl, 'Privacy Policy']].filter(([u]) => u);
|
|
151
164
|
body = (_jsxs("form", { onSubmit: submit(() => flow.current.acceptTerms()), children: [_jsxs("label", { style: { display: 'flex', gap: 8, alignItems: 'flex-start', fontSize: 14 }, children: [_jsx("input", { type: "checkbox", required: true }), _jsx("span", { children: sayAround(w, "I agree to {company}'s {links}", 'links', links.map(([u, t], i) => _jsxs("span", { children: [i ? ', ' : '', _jsx("a", { href: u, target: "_blank", rel: "noopener noreferrer", style: { color: c.link }, children: say(w, t) })] }, u)), { company: settings.name }) })] }), _jsx("button", { type: "submit", style: s.button, disabled: busy, children: say(w, 'Continue') })] }));
|
|
152
165
|
}
|
|
166
|
+
else if (status === 'needs_two_step_setup') {
|
|
167
|
+
const key = (step.secret ?? '').replace(/(.{4})/g, '$1 ').trim();
|
|
168
|
+
body = (_jsxs("form", { onSubmit: submit((f) => flow.current.verifyTwoStepSetup(text(f, 'code'))), children: [_jsx("p", { style: s.note, children: say(w, 'Your organization asks everyone to use two-step sign-in. It takes a minute.') }), _jsxs("ol", { style: { fontSize: 14, paddingInlineStart: 20, margin: '12px 0' }, children: [_jsx("li", { children: say(w, 'Open an authenticator app — Google Authenticator, Microsoft Authenticator, 1Password or any other.') }), _jsx("li", { children: say(w, 'Scan this code, then type the 6 digits it shows.') })] }), step.qr && _jsx("img", { src: step.qr, alt: say(w, 'QR code for your authenticator app'), width: 180, height: 180, style: { display: 'block', margin: '0 auto', background: '#fff', borderRadius: 8 } }), _jsx("p", { style: { ...s.note, overflowWrap: 'anywhere' }, children: sayAround(w, "Can't scan? Type this key: {key}", 'key', _jsx("code", { children: key })) }), field('code', say(w, '6-digit code'), { inputMode: 'numeric', autoComplete: 'one-time-code', autoFocus: true }), _jsx("button", { type: "submit", style: s.button, disabled: busy, children: say(w, 'Turn on two-step') })] }));
|
|
169
|
+
}
|
|
170
|
+
else if (status === 'needs_recovery_codes_saved') {
|
|
171
|
+
const codes = step.recoveryCodes ?? [];
|
|
172
|
+
body = (_jsxs(_Fragment, { children: [_jsx("p", { style: s.note, children: say(w, 'Two-step is on.') }), _jsx("ul", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 6, listStyle: 'none', padding: 0, margin: '14px 0', fontFamily: 'ui-monospace, monospace', fontSize: 14, textAlign: 'center' }, children: codes.map((code) => _jsx("li", { children: code }, code)) }), _jsx("p", { style: s.note, children: say(w, "Each one signs you in once if you lose your phone. This is the only time they're shown — keep them somewhere safe.") }), step.recoveryFile && _jsx("button", { type: "button", style: s.quiet, onClick: () => download(step.recoveryFileName ?? 'recovery-codes.txt', step.recoveryFile ?? ''), children: say(w, 'Download codes') }), _jsx("button", { type: "button", style: s.button, disabled: busy, onClick: () => void run(() => flow.current.recoveryCodesSaved()), children: say(w, "I've saved them — continue") })] }));
|
|
173
|
+
}
|
|
174
|
+
else if (status === 'needs_workspace') {
|
|
175
|
+
body = (_jsxs(_Fragment, { children: [_jsx("p", { style: s.note, children: say(w, 'The app opens in the one you choose.') }), (step.workspaces ?? []).map((ws) => (_jsx("button", { type: "button", style: s.quiet, disabled: busy, onClick: () => void run(() => flow.current.chooseWorkspace(ws.id)), children: ws.name }, ws.id)))] }));
|
|
176
|
+
}
|
|
153
177
|
else if (status === 'waiting') {
|
|
154
178
|
body = _jsx("p", { style: s.note, children: say(w, "Request sent. If an admin approves it, you'll get an invitation by email.") });
|
|
155
179
|
}
|
|
@@ -159,8 +183,12 @@ export function SignInBox({ setup, mode, locale, invitation, className, style })
|
|
|
159
183
|
const heading = status === 'needs_details' && step?.reason === 'invited' ? say(w, 'Join {name}', { name: settings.name })
|
|
160
184
|
: status === 'needs_legal_acceptance' ? say(w, 'Before you continue')
|
|
161
185
|
: status === 'needs_new_password' ? say(w, 'Choose a new password')
|
|
162
|
-
:
|
|
163
|
-
: say(w, '
|
|
186
|
+
: status === 'needs_two_step_setup' ? say(w, 'Set up two-step sign-in')
|
|
187
|
+
: status === 'needs_recovery_codes_saved' ? say(w, 'Save your recovery codes')
|
|
188
|
+
: status === 'needs_workspace' ? say(w, 'Choose a workspace')
|
|
189
|
+
: status === 'needs_device_code' ? say(w, 'Check your email')
|
|
190
|
+
: asSignUp ? say(w, 'Create your account for {name}', { name: settings.name })
|
|
191
|
+
: say(w, 'Sign in to {name}', { name: settings.name });
|
|
164
192
|
const fontUrl = settings.look.font?.url;
|
|
165
193
|
return (_jsxs("div", { className: className, style: s.card, lang: settings.lang, dir: settings.dir, children: [font && fontUrl && _jsx("style", { children: `@font-face{font-family:'${font.replace(/'/g, '')}';src:url('${fontUrl.replace(/'/g, '')}') format('woff2');font-display:swap}` }), logo && _jsx("img", { src: logo, alt: settings.name, style: { display: 'block', maxHeight: 40, margin: '0 auto 16px' } }), _jsx("h1", { style: s.title, children: heading }), body, problem && _jsx("p", { role: "alert", style: s.alert, children: problem }), settings.secured_by && _jsx("p", { style: s.foot, children: say(w, 'Secured by {name}', { name: 'Aiveth' }) })] }));
|
|
166
194
|
}
|
package/dist/here.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** What the next screen is. `signed_in`: done. `needs_aiveth`: send the browser to
|
|
2
2
|
* `continueUrl` (a step only Aiveth's page can do), or call `continueOnAiveth()`. */
|
|
3
|
-
export type StepStatus = 'needs_first_factor' | 'needs_second_factor' | 'needs_legal_acceptance' | 'needs_email_code' | 'needs_details' | 'needs_reset_code' | 'needs_new_password' | 'waiting' | 'needs_aiveth' | 'refused' | 'signed_in';
|
|
3
|
+
export type StepStatus = 'needs_first_factor' | 'needs_second_factor' | 'needs_legal_acceptance' | 'needs_email_code' | 'needs_details' | 'needs_reset_code' | 'needs_new_password' | 'needs_two_step_setup' | 'needs_recovery_codes_saved' | 'needs_workspace' | 'needs_device_code' | 'waiting' | 'needs_aiveth' | 'refused' | 'signed_in';
|
|
4
4
|
export interface Step {
|
|
5
5
|
status: StepStatus;
|
|
6
6
|
/** needs_first_factor: `password`, `email_code`, and `google` / `microsoft` / `github` / `sso`
|
|
@@ -12,6 +12,20 @@ export interface Step {
|
|
|
12
12
|
fields?: string[];
|
|
13
13
|
/** needs_details from an invitation: the address it was sent to. */
|
|
14
14
|
email?: string;
|
|
15
|
+
/** needs_two_step_setup: the QR code (an image address), its key to type by hand, its link. */
|
|
16
|
+
qr?: string;
|
|
17
|
+
secret?: string;
|
|
18
|
+
otpauthUri?: string;
|
|
19
|
+
/** needs_recovery_codes_saved: the codes, shown this once, and their file (name and text). */
|
|
20
|
+
recoveryCodes?: string[];
|
|
21
|
+
recoveryFileName?: string;
|
|
22
|
+
recoveryFile?: string;
|
|
23
|
+
/** needs_workspace: the person's workspaces to pick from. */
|
|
24
|
+
workspaces?: {
|
|
25
|
+
id: string;
|
|
26
|
+
slug: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}[];
|
|
15
29
|
reason?: string;
|
|
16
30
|
termsUrl?: string;
|
|
17
31
|
privacyUrl?: string;
|
|
@@ -82,6 +96,19 @@ export declare class HereFlow {
|
|
|
82
96
|
lastName?: string;
|
|
83
97
|
password: string;
|
|
84
98
|
}): Promise<Step>;
|
|
99
|
+
/** needs_two_step_setup (the organization requires two-step): the set-up again — the same QR
|
|
100
|
+
* while it is open, a fresh one after it took too long (a 410 from `verifyTwoStepSetup`). */
|
|
101
|
+
twoStepSetup(): Promise<Step>;
|
|
102
|
+
/** The 6 digits the authenticator app shows: two-step is on; the recovery codes come next. */
|
|
103
|
+
verifyTwoStepSetup(code: string): Promise<Step>;
|
|
104
|
+
/** The person saved their recovery codes: the sign-in goes on. */
|
|
105
|
+
recoveryCodesSaved(): Promise<Step>;
|
|
106
|
+
/** needs_device_code (a password from a new device): email the code — then `verifyDeviceCode`. */
|
|
107
|
+
sendDeviceCode(): Promise<Step>;
|
|
108
|
+
/** The code from the email: the device is known from now (kept in this browser). */
|
|
109
|
+
verifyDeviceCode(code: string): Promise<Step>;
|
|
110
|
+
/** needs_workspace: the workspace picked (its `id` or `slug`). */
|
|
111
|
+
chooseWorkspace(workspace: string): Promise<Step>;
|
|
85
112
|
/** After `needs_aiveth`: the rest on Aiveth's page, then back to your app. */
|
|
86
113
|
continueOnAiveth(): void;
|
|
87
114
|
}
|
package/dist/here.js
CHANGED
|
@@ -12,6 +12,24 @@ export class StepRefused extends Error {
|
|
|
12
12
|
this.name = 'StepRefused';
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
/** This browser's device token for the app (Aiveth's Client Trust: a password from a device the
|
|
16
|
+
* person hasn't proved asks for an emailed code first). Not a credential — the password is still
|
|
17
|
+
* asked; kept so the person isn't asked for a code on every sign-in. */
|
|
18
|
+
const DEVICE_KEY = 'aiveth.device.';
|
|
19
|
+
function readDevice(clientId) {
|
|
20
|
+
try {
|
|
21
|
+
return globalThis.localStorage?.getItem(DEVICE_KEY + clientId) ?? '';
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function keepDevice(clientId, token) {
|
|
28
|
+
try {
|
|
29
|
+
globalThis.localStorage?.setItem(DEVICE_KEY + clientId, token);
|
|
30
|
+
}
|
|
31
|
+
catch { /* private mode: asked again */ }
|
|
32
|
+
}
|
|
15
33
|
/** One sign-in, sign-up, new password or invitation on your page. Each method sends one step
|
|
16
34
|
* and answers the next; a `complete` answer is finished at once (`signed_in`). */
|
|
17
35
|
export class HereFlow {
|
|
@@ -40,6 +58,8 @@ export class HereFlow {
|
|
|
40
58
|
throw new StepRefused(res.status, typeof said.detail === 'string' ? said.detail : `Aiveth answered ${res.status}.`);
|
|
41
59
|
if (said.attempt)
|
|
42
60
|
this.attempt = said.attempt;
|
|
61
|
+
if (said.device_token)
|
|
62
|
+
keepDevice(this.setup.clientId, said.device_token);
|
|
43
63
|
if (said.status === 'complete')
|
|
44
64
|
return this.setup.finish(said.code ?? '', said.state ?? null);
|
|
45
65
|
if (said.continue_url)
|
|
@@ -48,6 +68,8 @@ export class HereFlow {
|
|
|
48
68
|
status: said.status, ways: said.ways, factors: said.factors, fields: said.fields,
|
|
49
69
|
email: said.email, reason: said.reason, termsUrl: said.terms_url, privacyUrl: said.privacy_url,
|
|
50
70
|
continueUrl: said.continue_url, error: said.error, errorDescription: said.error_description,
|
|
71
|
+
qr: said.qr, secret: said.secret, otpauthUri: said.otpauth_uri, recoveryCodes: said.recovery_codes,
|
|
72
|
+
recoveryFileName: said.recovery_file_name, recoveryFile: said.recovery_file, workspaces: said.workspaces,
|
|
51
73
|
};
|
|
52
74
|
}
|
|
53
75
|
at(kind, step) {
|
|
@@ -55,15 +77,15 @@ export class HereFlow {
|
|
|
55
77
|
}
|
|
56
78
|
/** @internal Begin with the address (a sign-in) — through `signInHere.start`. */
|
|
57
79
|
begin(request, email) {
|
|
58
|
-
return this.send('/attempts', { ...request, email });
|
|
80
|
+
return this.send('/attempts', { ...request, email, device: readDevice(this.setup.clientId) });
|
|
59
81
|
}
|
|
60
82
|
/** @internal Begin a sign-up — through `signInHere.signUp`. */
|
|
61
83
|
beginSignUp(request, email) {
|
|
62
|
-
return this.send('/sign-ups', { ...request, email });
|
|
84
|
+
return this.send('/sign-ups', { ...request, email, device: readDevice(this.setup.clientId) });
|
|
63
85
|
}
|
|
64
86
|
/** @internal Begin from an invitation link's token — through `signInHere.invitation`. */
|
|
65
87
|
beginInvitation(request, invitation) {
|
|
66
|
-
return this.send('/invitations', { ...request, invitation });
|
|
88
|
+
return this.send('/invitations', { ...request, invitation, device: readDevice(this.setup.clientId) });
|
|
67
89
|
}
|
|
68
90
|
password(password) { return this.send(this.at('attempts', 'password'), { password }); }
|
|
69
91
|
sendEmailCode() { return this.send(this.at('attempts', 'email-code')); }
|
|
@@ -83,6 +105,19 @@ export class HereFlow {
|
|
|
83
105
|
details(d) {
|
|
84
106
|
return this.send(this.at('sign-ups', 'details'), { first_name: d.firstName, last_name: d.lastName ?? '', password: d.password });
|
|
85
107
|
}
|
|
108
|
+
/** needs_two_step_setup (the organization requires two-step): the set-up again — the same QR
|
|
109
|
+
* while it is open, a fresh one after it took too long (a 410 from `verifyTwoStepSetup`). */
|
|
110
|
+
twoStepSetup() { return this.send(this.at('attempts', 'two-step-setup')); }
|
|
111
|
+
/** The 6 digits the authenticator app shows: two-step is on; the recovery codes come next. */
|
|
112
|
+
verifyTwoStepSetup(code) { return this.send(this.at('attempts', 'two-step-setup/verify'), { code }); }
|
|
113
|
+
/** The person saved their recovery codes: the sign-in goes on. */
|
|
114
|
+
recoveryCodesSaved() { return this.send(this.at('attempts', 'two-step-setup/saved')); }
|
|
115
|
+
/** needs_device_code (a password from a new device): email the code — then `verifyDeviceCode`. */
|
|
116
|
+
sendDeviceCode() { return this.send(this.at('attempts', 'device-code')); }
|
|
117
|
+
/** The code from the email: the device is known from now (kept in this browser). */
|
|
118
|
+
verifyDeviceCode(code) { return this.send(this.at('attempts', 'device-code/verify'), { code }); }
|
|
119
|
+
/** needs_workspace: the workspace picked (its `id` or `slug`). */
|
|
120
|
+
chooseWorkspace(workspace) { return this.send(this.at('attempts', 'workspace'), { workspace }); }
|
|
86
121
|
/** After `needs_aiveth`: the rest on Aiveth's page, then back to your app. */
|
|
87
122
|
continueOnAiveth() {
|
|
88
123
|
if (!this.continueUrl)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiveth/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Official Aiveth SDK for React: sign in on Aiveth's page with PKCE, tokens kept in memory, and ready-made sign-in pieces.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Aiveth team",
|