@molecule/app-settings-panel-vue 0.0.0-stage → 1.1.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/LICENSE +202 -0
- package/README.md +781 -2
- package/dist/AccountSection.d.ts +23 -0
- package/dist/AccountSection.d.ts.map +1 -0
- package/dist/AccountSection.js +139 -0
- package/dist/AccountSection.js.map +1 -0
- package/dist/AppearanceSection.d.ts +20 -0
- package/dist/AppearanceSection.d.ts.map +1 -0
- package/dist/AppearanceSection.js +47 -0
- package/dist/AppearanceSection.js.map +1 -0
- package/dist/AuthSection.d.ts +30 -0
- package/dist/AuthSection.d.ts.map +1 -0
- package/dist/AuthSection.js +320 -0
- package/dist/AuthSection.js.map +1 -0
- package/dist/BillingSection.d.ts +51 -0
- package/dist/BillingSection.d.ts.map +1 -0
- package/dist/BillingSection.js +84 -0
- package/dist/BillingSection.js.map +1 -0
- package/dist/DevicesSection.d.ts +52 -0
- package/dist/DevicesSection.d.ts.map +1 -0
- package/dist/DevicesSection.js +171 -0
- package/dist/DevicesSection.js.map +1 -0
- package/dist/LogOutDeleteSection.d.ts +22 -0
- package/dist/LogOutDeleteSection.d.ts.map +1 -0
- package/dist/LogOutDeleteSection.js +129 -0
- package/dist/LogOutDeleteSection.js.map +1 -0
- package/dist/NotificationsSection.d.ts +27 -0
- package/dist/NotificationsSection.d.ts.map +1 -0
- package/dist/NotificationsSection.js +148 -0
- package/dist/NotificationsSection.js.map +1 -0
- package/dist/SettingsContainer.d.ts +39 -0
- package/dist/SettingsContainer.d.ts.map +1 -0
- package/dist/SettingsContainer.js +48 -0
- package/dist/SettingsContainer.js.map +1 -0
- package/dist/ThisDeviceSection.d.ts +21 -0
- package/dist/ThisDeviceSection.d.ts.map +1 -0
- package/dist/ThisDeviceSection.js +57 -0
- package/dist/ThisDeviceSection.js.map +1 -0
- package/dist/TiersUpgradeSection.d.ts +56 -0
- package/dist/TiersUpgradeSection.d.ts.map +1 -0
- package/dist/TiersUpgradeSection.js +218 -0
- package/dist/TiersUpgradeSection.js.map +1 -0
- package/dist/context.d.ts +25 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +20 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/pushToggle.d.ts +12 -0
- package/dist/pushToggle.d.ts.map +1 -0
- package/dist/pushToggle.js +11 -0
- package/dist/pushToggle.js.map +1 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +72 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue account settings section: name/email fields over the shared profile
|
|
3
|
+
* form lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s
|
|
6
|
+
* `AccountSection` — the same DOM, callbacks and service calls.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type VNodeChild } from 'vue';
|
|
11
|
+
/**
|
|
12
|
+
* Account fields over the shared profile lifecycle. Background validation uses
|
|
13
|
+
* the auth client's configured route, mapping and session ownership guards.
|
|
14
|
+
*
|
|
15
|
+
* `UserProfile.email` is optional (phone/handle accounts have none), so email is
|
|
16
|
+
* validated only when non-empty and a blank email is never sent: clearing the
|
|
17
|
+
* field leaves the stored address untouched, and a name-only account can still
|
|
18
|
+
* save its name.
|
|
19
|
+
*
|
|
20
|
+
* @returns The account settings section component.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AccountSection: import("vue").DefineComponent<{}, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
//# sourceMappingURL=AccountSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountSection.d.ts","sourceRoot":"","sources":["../src/AccountSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA+D,KAAK,UAAU,EAAE,MAAM,KAAK,CAAA;AAalG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,0CA8DZ,UAAU,yOAoFvB,CAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue account settings section: name/email fields over the shared profile
|
|
3
|
+
* form lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s
|
|
6
|
+
* `AccountSection` — the same DOM, callbacks and service calls.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { defineComponent, h, onMounted } from 'vue';
|
|
11
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
12
|
+
import { Flex, Input, Spinner } from '@molecule/app-ui-vue';
|
|
13
|
+
import { useAuthClient, useProfileForm, useTranslation } from '@molecule/app-vue';
|
|
14
|
+
/**
|
|
15
|
+
* Account fields over the shared profile lifecycle. Background validation uses
|
|
16
|
+
* the auth client's configured route, mapping and session ownership guards.
|
|
17
|
+
*
|
|
18
|
+
* `UserProfile.email` is optional (phone/handle accounts have none), so email is
|
|
19
|
+
* validated only when non-empty and a blank email is never sent: clearing the
|
|
20
|
+
* field leaves the stored address untouched, and a name-only account can still
|
|
21
|
+
* save its name.
|
|
22
|
+
*
|
|
23
|
+
* @returns The account settings section component.
|
|
24
|
+
*/
|
|
25
|
+
export const AccountSection = defineComponent({
|
|
26
|
+
name: 'AccountSection',
|
|
27
|
+
setup() {
|
|
28
|
+
const cm = getClassMap();
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const authClient = useAuthClient();
|
|
31
|
+
const profile = useProfileForm({
|
|
32
|
+
defaultValues: { name: '', email: '' },
|
|
33
|
+
toValues: (user) => ({ name: user.name ?? '', email: user.email ?? '' }),
|
|
34
|
+
toPatch: ({ email, ...changes }) => (email ? { ...changes, email } : changes),
|
|
35
|
+
});
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
// The auth client owns the route, response mapping and stale-read guards.
|
|
38
|
+
// An older account read must not publish over a save or a different session.
|
|
39
|
+
void authClient.validateSession?.().catch((_error) => {
|
|
40
|
+
// A provider's background validation must not cause an unhandled rejection:
|
|
41
|
+
// render its auth state while useProfileForm reports mutation failures.
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Wraps a field's blur handler so the form saves after the field marks
|
|
46
|
+
* itself touched — the same save-on-blur React's version wires.
|
|
47
|
+
*
|
|
48
|
+
* @param onBlur - The registered field's blur handler.
|
|
49
|
+
* @returns A blur handler that saves the form.
|
|
50
|
+
*/
|
|
51
|
+
const saveOnBlur = (onBlur) => () => {
|
|
52
|
+
onBlur();
|
|
53
|
+
void profile.submit();
|
|
54
|
+
};
|
|
55
|
+
const registrations = {};
|
|
56
|
+
/**
|
|
57
|
+
* Builds a stable component ref that forwards the Input's native field
|
|
58
|
+
* element to the registration captured at the latest render.
|
|
59
|
+
*
|
|
60
|
+
* @param field - Which field's registration to forward to.
|
|
61
|
+
* @returns The component ref callback.
|
|
62
|
+
*/
|
|
63
|
+
const fieldRef = (field) => (instance) => {
|
|
64
|
+
const root = instance === null || instance instanceof Element
|
|
65
|
+
? null
|
|
66
|
+
: instance.$el;
|
|
67
|
+
registrations[field]?.ref?.((root?.querySelector('input') ?? null));
|
|
68
|
+
};
|
|
69
|
+
const nameFieldRef = fieldRef('name');
|
|
70
|
+
const emailFieldRef = fieldRef('email');
|
|
71
|
+
return () => {
|
|
72
|
+
// The subscription snapshot makes the render reactive to every form
|
|
73
|
+
// state change (values, errors, submit flag), like React's re-render.
|
|
74
|
+
void profile.formState.value;
|
|
75
|
+
const name = profile.register('name');
|
|
76
|
+
const email = profile.register('email', { email: true });
|
|
77
|
+
registrations.name = name;
|
|
78
|
+
registrations.email = email;
|
|
79
|
+
const emailError = profile.getError('email');
|
|
80
|
+
return h('section', [
|
|
81
|
+
h(Flex, { align: 'center', gap: 'sm', className: cm.sp('mb', 3) }, () => [
|
|
82
|
+
h('h3', { class: cm.sectionHeading }, [
|
|
83
|
+
t('settings.account', undefined, { defaultValue: 'Account' }),
|
|
84
|
+
]),
|
|
85
|
+
profile.isSubmitting.value ? h(Spinner, { size: 'xs' }) : null,
|
|
86
|
+
]),
|
|
87
|
+
h('form', { ...profile.formProps, class: cm.stack(3) }, [
|
|
88
|
+
h('div', [
|
|
89
|
+
h('label', { for: 'settings-name', class: cm.formLabelSmall }, t('settings.name', undefined, { defaultValue: 'Name' })),
|
|
90
|
+
h(Input, {
|
|
91
|
+
ref: nameFieldRef,
|
|
92
|
+
name: name.name,
|
|
93
|
+
value: name.value,
|
|
94
|
+
onChange: name.onChange,
|
|
95
|
+
onBlur: saveOnBlur(name.onBlur),
|
|
96
|
+
id: 'settings-name',
|
|
97
|
+
type: 'text',
|
|
98
|
+
autoComplete: 'name',
|
|
99
|
+
size: 'sm',
|
|
100
|
+
}),
|
|
101
|
+
]),
|
|
102
|
+
h('div', [
|
|
103
|
+
h('label', { for: 'settings-email', class: cm.formLabelSmall }, t('settings.email', undefined, { defaultValue: 'Email' })),
|
|
104
|
+
h(Input, {
|
|
105
|
+
ref: emailFieldRef,
|
|
106
|
+
name: email.name,
|
|
107
|
+
value: email.value,
|
|
108
|
+
onChange: email.onChange,
|
|
109
|
+
onBlur: saveOnBlur(email.onBlur),
|
|
110
|
+
id: 'settings-email',
|
|
111
|
+
type: 'email',
|
|
112
|
+
autoComplete: 'email',
|
|
113
|
+
size: 'sm',
|
|
114
|
+
'aria-invalid': emailError ? true : undefined,
|
|
115
|
+
'aria-describedby': emailError ? 'settings-email-error' : undefined,
|
|
116
|
+
}),
|
|
117
|
+
emailError
|
|
118
|
+
? h('p', {
|
|
119
|
+
id: 'settings-email-error',
|
|
120
|
+
role: 'alert',
|
|
121
|
+
class: cm.cn(cm.textSize('xs'), cm.textError, cm.sp('mt', 1)),
|
|
122
|
+
}, [emailError])
|
|
123
|
+
: null,
|
|
124
|
+
profile.error.value
|
|
125
|
+
? h('p', { role: 'alert', class: cm.cn(cm.textSize('xs'), cm.textError, cm.sp('mt', 1)) }, [
|
|
126
|
+
profile.error.value instanceof Error
|
|
127
|
+
? profile.error.value.message
|
|
128
|
+
: t('settings.failedToUpdateProfile', undefined, {
|
|
129
|
+
defaultValue: 'Failed to update profile',
|
|
130
|
+
}),
|
|
131
|
+
])
|
|
132
|
+
: null,
|
|
133
|
+
]),
|
|
134
|
+
]),
|
|
135
|
+
]);
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=AccountSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountSection.js","sourceRoot":"","sources":["../src/AccountSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAgC,eAAe,EAAE,CAAC,EAAE,SAAS,EAAmB,MAAM,KAAK,CAAA;AAGlG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAQjF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;IAC5C,IAAI,EAAE,gBAAgB;IACtB,KAAK;QACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;QAC9B,MAAM,UAAU,GAAG,aAAa,EAAe,CAAA;QAC/C,MAAM,OAAO,GAAG,cAAc,CAA6B;YACzD,aAAa,E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,CAAC;wBACF,UAAU;4BACR,CAAC,CAAC,CAAC,CACC,GAAG,EACH;gCACE,EAAE,EAAE,sBAAsB;gCAC1B,IAAI,EAAE,OAAO;gCACb,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;6BAC9D,EACD,CAAC,UAAU,CAAC,CACb;4BACH,CAAC,CAAC,IAAI;wBACR,OAAO,CAAC,KAAK,CAAC,KAAK;4BACjB,CAAC,CAAC,CAAC,CACC,GAAG,EACH,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAChF;gCACE,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK;oCAClC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO;oCAC7B,CAAC,CAAC,CAAC,CAAC,gCAAgC,EAAE,SAAS,EAAE;wCAC7C,YAAY,EAAE,0BAA0B;qCACzC,CAAC;6BACP,CACF;4BACH,CAAC,CAAC,IAAI;qBACT,CAAC;iBACH,CAAC;aACH,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue appearance section: the dark-mode switch wired to the theme bond.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s
|
|
5
|
+
* `AppearanceSection` — the same DOM, callbacks and service calls.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { type VNodeChild } from 'vue';
|
|
10
|
+
/**
|
|
11
|
+
* Appearance section — dark-mode toggle wired to the theme bond.
|
|
12
|
+
*
|
|
13
|
+
* Apps that expose other appearance knobs (font size, density, etc.)
|
|
14
|
+
* can either add more sub-components to this package or render their
|
|
15
|
+
* own section in line with `<AppearanceSection>` via slots.
|
|
16
|
+
*
|
|
17
|
+
* @returns The appearance section component.
|
|
18
|
+
*/
|
|
19
|
+
export declare const AppearanceSection: import("vue").DefineComponent<{}, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
//# sourceMappingURL=AppearanceSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppearanceSection.d.ts","sourceRoot":"","sources":["../src/AppearanceSection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAA;AAMzD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,0CAOf,UAAU,yOAmBvB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue appearance section: the dark-mode switch wired to the theme bond.
|
|
3
|
+
*
|
|
4
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s
|
|
5
|
+
* `AppearanceSection` — the same DOM, callbacks and service calls.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { defineComponent, h } from 'vue';
|
|
10
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
11
|
+
import { Flex, Switch } from '@molecule/app-ui-vue';
|
|
12
|
+
import { useTheme, useTranslation } from '@molecule/app-vue';
|
|
13
|
+
/**
|
|
14
|
+
* Appearance section — dark-mode toggle wired to the theme bond.
|
|
15
|
+
*
|
|
16
|
+
* Apps that expose other appearance knobs (font size, density, etc.)
|
|
17
|
+
* can either add more sub-components to this package or render their
|
|
18
|
+
* own section in line with `<AppearanceSection>` via slots.
|
|
19
|
+
*
|
|
20
|
+
* @returns The appearance section component.
|
|
21
|
+
*/
|
|
22
|
+
export const AppearanceSection = defineComponent({
|
|
23
|
+
name: 'AppearanceSection',
|
|
24
|
+
setup() {
|
|
25
|
+
const cm = getClassMap();
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
const { mode, toggleTheme } = useTheme();
|
|
28
|
+
return () => h('section', [
|
|
29
|
+
h('h3', { class: cm.cn(cm.sectionHeading, cm.sp('mb', 3)) }, [
|
|
30
|
+
t('settings.appearance', undefined, { defaultValue: 'Appearance' }),
|
|
31
|
+
]),
|
|
32
|
+
h(Flex, { align: 'center', justify: 'between' }, () => [
|
|
33
|
+
h('span', { class: cm.textSize('sm') }, [
|
|
34
|
+
t('settings.darkMode', undefined, { defaultValue: 'Dark mode' }),
|
|
35
|
+
]),
|
|
36
|
+
h(Switch, {
|
|
37
|
+
id: 'settings-theme-toggle',
|
|
38
|
+
'aria-label': t('theme.toggle', undefined, { defaultValue: 'Toggle theme' }),
|
|
39
|
+
checked: mode.value === 'dark',
|
|
40
|
+
onChange: () => toggleTheme(),
|
|
41
|
+
size: 'sm',
|
|
42
|
+
}),
|
|
43
|
+
]),
|
|
44
|
+
]);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=AppearanceSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppearanceSection.js","sourceRoot":"","sources":["../src/AppearanceSection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,c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AA;IACN,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue authentication section: the change-password modal and the TOTP
|
|
3
|
+
* two-factor enrollment flow.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s `AuthSection` —
|
|
6
|
+
* the same DOM, callbacks and service calls.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type VNodeChild } from 'vue';
|
|
11
|
+
/**
|
|
12
|
+
* Authentication section — change password (modal) + two-factor (TOTP) setup.
|
|
13
|
+
*
|
|
14
|
+
* Two-factor uses the real enrollment flow against the user resource's
|
|
15
|
+
* `POST /users/:id/verify-two-factor` endpoint (`@molecule/api-two-factor`):
|
|
16
|
+
* - Enable → `{action:'setup'}` returns a QR code + secret to scan into an
|
|
17
|
+
* authenticator app → user enters the 6-digit code → `{action:'enable', token}`.
|
|
18
|
+
* - Disable → user enters a current code → `{action:'disable', token}`.
|
|
19
|
+
* The current status is read from `/users/me`. (This replaces the previous
|
|
20
|
+
* boolean toggle, which PATCHed `twoFactorEnabled` — a field the update
|
|
21
|
+
* handler deliberately ignores — so it never actually enrolled 2FA.)
|
|
22
|
+
*
|
|
23
|
+
* Auto-hides for OAuth-only users (`user.oauthServer` truthy) since
|
|
24
|
+
* password / 2FA wouldn't apply. If the app's API has no two-factor
|
|
25
|
+
* provider bonded, setup fails gracefully with an inline message.
|
|
26
|
+
*
|
|
27
|
+
* @returns The authentication section component.
|
|
28
|
+
*/
|
|
29
|
+
export declare const AuthSection: import("vue").DefineComponent<{}, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
//# sourceMappingURL=AuthSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthSection.d.ts","sourceRoot":"","sources":["../src/AuthSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA6D,KAAK,UAAU,EAAE,MAAM,KAAK,CAAA;AAehG;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,0CAsHT,UAAU,yOA0OvB,CAAA"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue authentication section: the change-password modal and the TOTP
|
|
3
|
+
* two-factor enrollment flow.
|
|
4
|
+
*
|
|
5
|
+
* Vue counterpart of `@molecule/app-settings-panel-react`'s `AuthSection` —
|
|
6
|
+
* the same DOM, callbacks and service calls.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { defineComponent, h, onMounted, onUnmounted, ref } from 'vue';
|
|
11
|
+
import { serverErrorMessage } from '@molecule/app-http';
|
|
12
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
13
|
+
import { Alert, Button, Flex, Input, Modal } from '@molecule/app-ui-vue';
|
|
14
|
+
import { useAuth, useChangePassword, useHttpClient, useTranslation } from '@molecule/app-vue';
|
|
15
|
+
/**
|
|
16
|
+
* Authentication section — change password (modal) + two-factor (TOTP) setup.
|
|
17
|
+
*
|
|
18
|
+
* Two-factor uses the real enrollment flow against the user resource's
|
|
19
|
+
* `POST /users/:id/verify-two-factor` endpoint (`@molecule/api-two-factor`):
|
|
20
|
+
* - Enable → `{action:'setup'}` returns a QR code + secret to scan into an
|
|
21
|
+
* authenticator app → user enters the 6-digit code → `{action:'enable', token}`.
|
|
22
|
+
* - Disable → user enters a current code → `{action:'disable', token}`.
|
|
23
|
+
* The current status is read from `/users/me`. (This replaces the previous
|
|
24
|
+
* boolean toggle, which PATCHed `twoFactorEnabled` — a field the update
|
|
25
|
+
* handler deliberately ignores — so it never actually enrolled 2FA.)
|
|
26
|
+
*
|
|
27
|
+
* Auto-hides for OAuth-only users (`user.oauthServer` truthy) since
|
|
28
|
+
* password / 2FA wouldn't apply. If the app's API has no two-factor
|
|
29
|
+
* provider bonded, setup fails gracefully with an inline message.
|
|
30
|
+
*
|
|
31
|
+
* @returns The authentication section component.
|
|
32
|
+
*/
|
|
33
|
+
export const AuthSection = defineComponent({
|
|
34
|
+
name: 'AuthSection',
|
|
35
|
+
setup() {
|
|
36
|
+
const cm = getClassMap();
|
|
37
|
+
const { t } = useTranslation();
|
|
38
|
+
const { user } = useAuth();
|
|
39
|
+
const http = useHttpClient();
|
|
40
|
+
const { status, error, changePassword, reset } = useChangePassword();
|
|
41
|
+
const showModal = ref(false);
|
|
42
|
+
const currentPassword = ref('');
|
|
43
|
+
const newPassword = ref('');
|
|
44
|
+
const twoFactorEnabled = ref(false);
|
|
45
|
+
const tfModal = ref(null);
|
|
46
|
+
const tfSetup = ref(null);
|
|
47
|
+
const tfToken = ref('');
|
|
48
|
+
const tfLoading = ref(false);
|
|
49
|
+
const tfError = ref('');
|
|
50
|
+
// Read the persisted 2FA status from /users/me on mount.
|
|
51
|
+
let cancelled = false;
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
http
|
|
54
|
+
.get('/api/users/me')
|
|
55
|
+
.then((res) => {
|
|
56
|
+
if (cancelled)
|
|
57
|
+
return;
|
|
58
|
+
const body = res.data ?? res;
|
|
59
|
+
const u = (body.props ?? body);
|
|
60
|
+
twoFactorEnabled.value = Boolean(u?.twoFactorEnabled);
|
|
61
|
+
})
|
|
62
|
+
.catch((_error) => {
|
|
63
|
+
// status read is best-effort; defaults to disabled
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
onUnmounted(() => {
|
|
67
|
+
cancelled = true;
|
|
68
|
+
});
|
|
69
|
+
/** Resets the two-factor modal state. */
|
|
70
|
+
const closeTf = () => {
|
|
71
|
+
tfModal.value = null;
|
|
72
|
+
tfSetup.value = null;
|
|
73
|
+
tfToken.value = '';
|
|
74
|
+
tfError.value = '';
|
|
75
|
+
};
|
|
76
|
+
/** Asks the server for a QR seed and opens the enable flow. */
|
|
77
|
+
const startEnable = async () => {
|
|
78
|
+
tfError.value = '';
|
|
79
|
+
tfLoading.value = true;
|
|
80
|
+
tfModal.value = 'enable';
|
|
81
|
+
try {
|
|
82
|
+
const res = await http.post(`/api/users/${user.value?.id}/verify-two-factor`, {
|
|
83
|
+
action: 'setup',
|
|
84
|
+
});
|
|
85
|
+
const data = (res.data ?? res);
|
|
86
|
+
tfSetup.value = data;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
tfError.value =
|
|
90
|
+
serverErrorMessage(err) ??
|
|
91
|
+
t('settings.twoFactorUnavailable', undefined, {
|
|
92
|
+
defaultValue: 'Two-factor authentication is not available for this app.',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
tfLoading.value = false;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Submits the entered code for the chosen action and closes the modal.
|
|
101
|
+
*
|
|
102
|
+
* @param action - `'enable'` turns two-factor on, `'disable'` off.
|
|
103
|
+
*/
|
|
104
|
+
const submitTf = async (action) => {
|
|
105
|
+
tfError.value = '';
|
|
106
|
+
tfLoading.value = true;
|
|
107
|
+
try {
|
|
108
|
+
await http.post(`/api/users/${user.value?.id}/verify-two-factor`, {
|
|
109
|
+
action,
|
|
110
|
+
token: tfToken.value,
|
|
111
|
+
});
|
|
112
|
+
twoFactorEnabled.value = action === 'enable';
|
|
113
|
+
closeTf();
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
tfError.value =
|
|
117
|
+
serverErrorMessage(err) ??
|
|
118
|
+
t('settings.twoFactorInvalidCode', undefined, { defaultValue: 'Invalid code' });
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
tfLoading.value = false;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Submits the change-password form; the hook's error state holds failures.
|
|
126
|
+
*
|
|
127
|
+
* @param event - The native form submit event.
|
|
128
|
+
*/
|
|
129
|
+
const handleChangePassword = async (event) => {
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
try {
|
|
132
|
+
await changePassword(currentPassword.value, newPassword.value);
|
|
133
|
+
showModal.value = false;
|
|
134
|
+
currentPassword.value = '';
|
|
135
|
+
newPassword.value = '';
|
|
136
|
+
reset();
|
|
137
|
+
}
|
|
138
|
+
catch (_error) {
|
|
139
|
+
// Error tracked in hook state — useChangePassword surfaces it via `error`.
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
return () => {
|
|
143
|
+
// OAuth users skip this section entirely.
|
|
144
|
+
if (user.value?.oauthServer)
|
|
145
|
+
return null;
|
|
146
|
+
const children = [
|
|
147
|
+
h('section', [
|
|
148
|
+
h('h3', { class: cm.cn(cm.sectionHeading, cm.sp('mb', 3)) }, [
|
|
149
|
+
t('settings.authentication', undefined, { defaultValue: 'Authentication' }),
|
|
150
|
+
]),
|
|
151
|
+
h('div', { class: cm.stack(3) }, [
|
|
152
|
+
h(Button, { variant: 'outline', size: 'sm', onClick: () => (showModal.value = true) }, () => [t('settings.changePassword', undefined, { defaultValue: 'Change password' })]),
|
|
153
|
+
h(Flex, { align: 'center', justify: 'between' }, () => [
|
|
154
|
+
h('span', { class: cm.textSize('sm') }, [
|
|
155
|
+
t('settings.twoFactor', undefined, {
|
|
156
|
+
defaultValue: 'Two-factor authentication',
|
|
157
|
+
}),
|
|
158
|
+
twoFactorEnabled.value
|
|
159
|
+
? h('span', { class: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.sp('ml', 2)) }, [
|
|
160
|
+
t('settings.twoFactorOn', undefined, { defaultValue: 'On' }),
|
|
161
|
+
])
|
|
162
|
+
: null,
|
|
163
|
+
]),
|
|
164
|
+
twoFactorEnabled.value
|
|
165
|
+
? h(Button, {
|
|
166
|
+
variant: 'outline',
|
|
167
|
+
size: 'sm',
|
|
168
|
+
onClick: () => {
|
|
169
|
+
tfError.value = '';
|
|
170
|
+
tfToken.value = '';
|
|
171
|
+
tfModal.value = 'disable';
|
|
172
|
+
},
|
|
173
|
+
'data-mol-id': 'two-factor-disable',
|
|
174
|
+
}, () => [t('settings.twoFactorDisable', undefined, { defaultValue: 'Disable' })])
|
|
175
|
+
: h(Button, {
|
|
176
|
+
variant: 'outline',
|
|
177
|
+
size: 'sm',
|
|
178
|
+
onClick: () => void startEnable(),
|
|
179
|
+
'data-mol-id': 'two-factor-enable',
|
|
180
|
+
}, () => [t('settings.twoFactorEnable', undefined, { defaultValue: 'Enable' })]),
|
|
181
|
+
]),
|
|
182
|
+
]),
|
|
183
|
+
]),
|
|
184
|
+
h(Modal, {
|
|
185
|
+
open: showModal.value,
|
|
186
|
+
onClose: () => {
|
|
187
|
+
showModal.value = false;
|
|
188
|
+
reset();
|
|
189
|
+
},
|
|
190
|
+
title: t('settings.changePasswordModal.title', undefined, {
|
|
191
|
+
defaultValue: 'Change Password',
|
|
192
|
+
}),
|
|
193
|
+
}, {
|
|
194
|
+
default: () => [
|
|
195
|
+
error.value
|
|
196
|
+
? h(Alert, { status: 'error', className: cm.sp('mb', 4) }, () => [
|
|
197
|
+
error.value?.message ||
|
|
198
|
+
t('settings.changePasswordModal.error', undefined, {
|
|
199
|
+
defaultValue: 'Failed to change password.',
|
|
200
|
+
}),
|
|
201
|
+
])
|
|
202
|
+
: null,
|
|
203
|
+
h('form', { onSubmit: handleChangePassword, class: cm.stack(4) }, [
|
|
204
|
+
h('div', [
|
|
205
|
+
h('label', { for: 'current-pw', class: cm.formLabel }, t('settings.changePasswordModal.currentPassword', undefined, {
|
|
206
|
+
defaultValue: 'Current Password',
|
|
207
|
+
})),
|
|
208
|
+
h(Input, {
|
|
209
|
+
id: 'current-pw',
|
|
210
|
+
type: 'password',
|
|
211
|
+
value: currentPassword.value,
|
|
212
|
+
onChange: (e) => (currentPassword.value = e.target.value),
|
|
213
|
+
autoComplete: 'current-password',
|
|
214
|
+
required: true,
|
|
215
|
+
}),
|
|
216
|
+
]),
|
|
217
|
+
h('div', [
|
|
218
|
+
h('label', { for: 'new-pw', class: cm.formLabel }, t('settings.changePasswordModal.newPassword', undefined, {
|
|
219
|
+
defaultValue: 'New Password',
|
|
220
|
+
})),
|
|
221
|
+
h(Input, {
|
|
222
|
+
id: 'new-pw',
|
|
223
|
+
type: 'password',
|
|
224
|
+
value: newPassword.value,
|
|
225
|
+
onChange: (e) => (newPassword.value = e.target.value),
|
|
226
|
+
autoComplete: 'new-password',
|
|
227
|
+
required: true,
|
|
228
|
+
}),
|
|
229
|
+
]),
|
|
230
|
+
h(Button, { type: 'submit', fullWidth: true, loading: status.value === 'pending' }, () => [
|
|
231
|
+
status.value === 'pending'
|
|
232
|
+
? t('settings.changePasswordModal.changing', undefined, {
|
|
233
|
+
defaultValue: 'Changing...',
|
|
234
|
+
})
|
|
235
|
+
: t('settings.changePassword', undefined, {
|
|
236
|
+
defaultValue: 'Change password',
|
|
237
|
+
}),
|
|
238
|
+
]),
|
|
239
|
+
]),
|
|
240
|
+
],
|
|
241
|
+
}),
|
|
242
|
+
h(Modal, {
|
|
243
|
+
open: tfModal.value !== null,
|
|
244
|
+
onClose: closeTf,
|
|
245
|
+
title: tfModal.value === 'disable'
|
|
246
|
+
? t('settings.twoFactorDisableTitle', undefined, {
|
|
247
|
+
defaultValue: 'Disable two-factor authentication',
|
|
248
|
+
})
|
|
249
|
+
: t('settings.twoFactorEnableTitle', undefined, {
|
|
250
|
+
defaultValue: 'Enable two-factor authentication',
|
|
251
|
+
}),
|
|
252
|
+
}, {
|
|
253
|
+
default: () => [
|
|
254
|
+
tfError.value
|
|
255
|
+
? h(Alert, { status: 'error', className: cm.sp('mb', 4) }, () => [tfError.value])
|
|
256
|
+
: null,
|
|
257
|
+
tfModal.value === 'enable' && tfSetup.value?.QRImageUrl
|
|
258
|
+
? h('div', { class: cm.cn(cm.stack(3), cm.sp('mb', 4)) }, [
|
|
259
|
+
h('p', { class: cm.cn(cm.textSize('sm'), cm.textMuted) }, [
|
|
260
|
+
t('settings.twoFactorScan', undefined, {
|
|
261
|
+
defaultValue: 'Scan this QR code with your authenticator app, then enter the 6-digit code.',
|
|
262
|
+
}),
|
|
263
|
+
]),
|
|
264
|
+
h('img', {
|
|
265
|
+
src: tfSetup.value?.QRImageUrl,
|
|
266
|
+
alt: t('settings.twoFactorQrAlt', undefined, {
|
|
267
|
+
defaultValue: 'Two-factor QR code',
|
|
268
|
+
}),
|
|
269
|
+
class: cm.cn(cm.mxAuto, cm.maxW('xs')),
|
|
270
|
+
}),
|
|
271
|
+
tfSetup.value?.secret
|
|
272
|
+
? h('p', {
|
|
273
|
+
class: cm.cn(cm.textSize('xs'), cm.textSubtle, cm.settingsPanelTwoFactorSecret),
|
|
274
|
+
}, [tfSetup.value.secret])
|
|
275
|
+
: null,
|
|
276
|
+
])
|
|
277
|
+
: null,
|
|
278
|
+
tfModal.value === 'disable' || tfSetup.value
|
|
279
|
+
? h('form', {
|
|
280
|
+
onSubmit: (e) => {
|
|
281
|
+
e.preventDefault();
|
|
282
|
+
void submitTf(tfModal.value === 'disable' ? 'disable' : 'enable');
|
|
283
|
+
},
|
|
284
|
+
class: cm.stack(4),
|
|
285
|
+
}, [
|
|
286
|
+
h('div', [
|
|
287
|
+
h('label', { for: 'tf-token', class: cm.formLabel }, t('settings.twoFactorCode', undefined, {
|
|
288
|
+
defaultValue: 'Authentication code',
|
|
289
|
+
})),
|
|
290
|
+
h(Input, {
|
|
291
|
+
id: 'tf-token',
|
|
292
|
+
type: 'text',
|
|
293
|
+
value: tfToken.value,
|
|
294
|
+
onChange: (e) => (tfToken.value = e.target.value),
|
|
295
|
+
autoComplete: 'one-time-code',
|
|
296
|
+
required: true,
|
|
297
|
+
}),
|
|
298
|
+
]),
|
|
299
|
+
h(Button, {
|
|
300
|
+
type: 'submit',
|
|
301
|
+
color: tfModal.value === 'disable' ? 'error' : undefined,
|
|
302
|
+
fullWidth: true,
|
|
303
|
+
loading: tfLoading.value,
|
|
304
|
+
}, () => [
|
|
305
|
+
tfModal.value === 'disable'
|
|
306
|
+
? t('settings.twoFactorDisable', undefined, { defaultValue: 'Disable' })
|
|
307
|
+
: t('settings.twoFactorVerify', undefined, {
|
|
308
|
+
defaultValue: 'Verify & enable',
|
|
309
|
+
}),
|
|
310
|
+
]),
|
|
311
|
+
])
|
|
312
|
+
: null,
|
|
313
|
+
],
|
|
314
|
+
}),
|
|
315
|
+
];
|
|
316
|
+
return children;
|
|
317
|
+
};
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
//# sourceMappingURL=AuthSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthSection.js","sourceRoot":"","sources":["../src/AuthSection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,EAAY,GAAG,EAAmB,MAAM,KAAK,CAAA;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAS7F;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK;QACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;QACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;QAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAe,CAAA;QACvC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAA;QAC5B,MAAM,EAAE,MAAM,EAAE,KA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