@burdenoff/microfe-auth 2026.624.3 → 2026.625.1
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/dist/auth/pages/AuditLogPage.js +73 -72
- package/dist/auth/pages/AuditLogPage.js.map +1 -1
- package/dist/auth/pages/EmailVerifyPage.js +58 -53
- package/dist/auth/pages/EmailVerifyPage.js.map +1 -1
- package/dist/auth/pages/LoginPage.js +222 -214
- package/dist/auth/pages/LoginPage.js.map +1 -1
- package/dist/auth/pages/MagicLinkPage.js +75 -68
- package/dist/auth/pages/MagicLinkPage.js.map +1 -1
- package/dist/auth/pages/MfaSetupPage.js +176 -138
- package/dist/auth/pages/MfaSetupPage.js.map +1 -1
- package/dist/auth/pages/MfaVerifyPage.js +60 -52
- package/dist/auth/pages/MfaVerifyPage.js.map +1 -1
- package/dist/auth/pages/PasswordResetPage.js +277 -262
- package/dist/auth/pages/PasswordResetPage.js.map +1 -1
- package/dist/auth/pages/ReactivatePage.js +54 -46
- package/dist/auth/pages/ReactivatePage.js.map +1 -1
- package/dist/auth/pages/RegisterPage.js +223 -213
- package/dist/auth/pages/RegisterPage.js.map +1 -1
- package/dist/auth/pages/SecurityPage.js +298 -267
- package/dist/auth/pages/SecurityPage.js.map +1 -1
- package/dist/auth/pages/SessionsPage.js +169 -160
- package/dist/auth/pages/SessionsPage.js.map +1 -1
- package/dist/auth/pages/SsoCallbackPage.js +53 -50
- package/dist/auth/pages/SsoCallbackPage.js.map +1 -1
- package/dist/auth/pages/SsoConfigPage.js +466 -444
- package/dist/auth/pages/SsoConfigPage.js.map +1 -1
- package/dist/auth/pages/SsoLoginPage.js +67 -59
- package/dist/auth/pages/SsoLoginPage.js.map +1 -1
- package/dist/auth/pages/UserDetailsPage.js +154 -144
- package/dist/auth/pages/UserDetailsPage.js.map +1 -1
- package/dist/auth/pages/UserProfilePage.js +211 -170
- package/dist/auth/pages/UserProfilePage.js.map +1 -1
- package/dist/auth/pages/UsersPage.js +572 -576
- package/dist/auth/pages/UsersPage.js.map +1 -1
- package/dist/microfe-auth.css +1 -1
- package/package.json +2 -2
|
@@ -7,28 +7,30 @@ import { useEffect as u, useId as d, useRef as f, useState as p } from "react";
|
|
|
7
7
|
import { useNavigate as m } from "react-router-dom";
|
|
8
8
|
import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
9
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { Button as y } from "@burdenoff/fe-libs/button";
|
|
11
|
+
import { NextSteps as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { useGatewayClient as S } from "@burdenoff/fe-libs/shared/graphql";
|
|
13
|
+
import { useAuth as C } from "@burdenoff/fe-libs/shared/providers/shell/AuthProvider";
|
|
12
14
|
//#region src/auth/pages/UserProfilePage.tsx
|
|
13
|
-
function
|
|
14
|
-
let { t:
|
|
15
|
-
let n =
|
|
15
|
+
function w() {
|
|
16
|
+
let { t: w } = h(), T = (e, t) => {
|
|
17
|
+
let n = w(e);
|
|
16
18
|
return n === e ? t : n;
|
|
17
|
-
},
|
|
19
|
+
}, E = m(), D = C(), O = e((e) => e.isAuthenticated), k = e((e) => e.user), A = e((e) => e.setUser), { updateCurrentUserProfile: j, isLoading: M } = s(), N = d(), P = d(), F = d(), I = d(), L = d(), R = e((e) => e.currentWorkspaceId), z = S("workspace"), [B] = l({ client: z }), [V] = c({ client: z }), H = f(null), [U, W] = p(!1), G = async (e) => {
|
|
18
20
|
let t = e.target.files?.[0];
|
|
19
21
|
if (!t) return;
|
|
20
22
|
if (!t.type.startsWith("image/")) {
|
|
21
|
-
|
|
23
|
+
Z(T("auth.profile.invalidImageType", "Please select an image file"));
|
|
22
24
|
return;
|
|
23
25
|
}
|
|
24
|
-
if (!
|
|
25
|
-
|
|
26
|
+
if (!R) {
|
|
27
|
+
Z(T("auth.profile.noWorkspace", "Please select a workspace before uploading a profile picture"));
|
|
26
28
|
return;
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
let n = { "x-workspace-id":
|
|
30
|
+
W(!0), Z(null);
|
|
31
|
+
let n = { "x-workspace-id": R };
|
|
30
32
|
try {
|
|
31
|
-
let e = t.name.split(".").pop()?.toLowerCase() ?? "", r = await
|
|
33
|
+
let e = t.name.split(".").pop()?.toLowerCase() ?? "", r = await B({
|
|
32
34
|
variables: { input: {
|
|
33
35
|
fileName: t.name,
|
|
34
36
|
fileSize: t.size.toString(),
|
|
@@ -43,38 +45,38 @@ function x() {
|
|
|
43
45
|
headers: { "Content-Type": t.type },
|
|
44
46
|
body: t
|
|
45
47
|
})).ok) throw Error("Failed to upload file");
|
|
46
|
-
let o = (await
|
|
48
|
+
let o = (await V({
|
|
47
49
|
variables: { input: { sessionId: i.id } },
|
|
48
50
|
context: { headers: n }
|
|
49
51
|
})).data?.completeUpload.file?.downloadUrl;
|
|
50
52
|
if (!o) throw Error("Upload succeeded but no URL returned");
|
|
51
|
-
await
|
|
52
|
-
...
|
|
53
|
+
await j({ avatar: o }), k && A({
|
|
54
|
+
...k,
|
|
53
55
|
avatar: o
|
|
54
|
-
}),
|
|
56
|
+
}), D.updateUser({ avatar: o }), $(T("auth.profile.avatarUpdated", "Profile picture updated!"));
|
|
55
57
|
} catch (e) {
|
|
56
|
-
|
|
58
|
+
Z(e instanceof Error ? e.message : T("auth.profile.avatarFailed", "Failed to upload picture"));
|
|
57
59
|
} finally {
|
|
58
|
-
|
|
60
|
+
W(!1), H.current && (H.current.value = "");
|
|
59
61
|
}
|
|
60
|
-
}, [
|
|
62
|
+
}, [K, q] = p(!1), [J, Y] = p({
|
|
61
63
|
username: "",
|
|
62
64
|
firstName: "",
|
|
63
65
|
lastName: "",
|
|
64
66
|
name: "",
|
|
65
67
|
phoneNumber: ""
|
|
66
|
-
}), [
|
|
68
|
+
}), [X, Z] = p(null), [Q, $] = p(null);
|
|
67
69
|
return u(() => {
|
|
68
|
-
|
|
69
|
-
username:
|
|
70
|
-
firstName:
|
|
71
|
-
lastName:
|
|
72
|
-
name:
|
|
73
|
-
phoneNumber:
|
|
70
|
+
k && Y({
|
|
71
|
+
username: k.username || "",
|
|
72
|
+
firstName: k.firstName || "",
|
|
73
|
+
lastName: k.lastName || "",
|
|
74
|
+
name: k.name || "",
|
|
75
|
+
phoneNumber: k.phoneNumber || ""
|
|
74
76
|
});
|
|
75
|
-
}, [
|
|
76
|
-
title:
|
|
77
|
-
subtitle:
|
|
77
|
+
}, [k]), !O || !k ? /* @__PURE__ */ _(t, {
|
|
78
|
+
title: T("auth.profile.title", "Profile"),
|
|
79
|
+
subtitle: T("auth.profile.subtitle", "View and manage your profile"),
|
|
78
80
|
children: /* @__PURE__ */ v("div", {
|
|
79
81
|
className: "text-center py-12",
|
|
80
82
|
children: [
|
|
@@ -84,17 +86,19 @@ function x() {
|
|
|
84
86
|
}),
|
|
85
87
|
/* @__PURE__ */ _("h2", {
|
|
86
88
|
className: "text-xl font-semibold text-[var(--color-text-primary)] mb-2",
|
|
87
|
-
children:
|
|
89
|
+
children: T("auth.profile.authRequired", "Authentication Required")
|
|
88
90
|
}),
|
|
89
91
|
/* @__PURE__ */ _("p", {
|
|
90
92
|
className: "text-[var(--color-text-secondary)] mb-6",
|
|
91
|
-
children:
|
|
93
|
+
children: T("auth.profile.signInToView", "Please sign in to view your profile")
|
|
92
94
|
}),
|
|
93
|
-
/* @__PURE__ */ _(
|
|
95
|
+
/* @__PURE__ */ _(y, {
|
|
94
96
|
type: "button",
|
|
95
|
-
onClick: () =>
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
onClick: () => E("/auth/login"),
|
|
98
|
+
variant: "default",
|
|
99
|
+
size: "lg",
|
|
100
|
+
className: "font-semibold",
|
|
101
|
+
children: T("auth.profile.signIn", "Sign In")
|
|
98
102
|
})
|
|
99
103
|
]
|
|
100
104
|
})
|
|
@@ -103,31 +107,38 @@ function x() {
|
|
|
103
107
|
children: [
|
|
104
108
|
/* @__PURE__ */ v("div", {
|
|
105
109
|
className: "mb-8",
|
|
106
|
-
children: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ _("h1", {
|
|
112
|
+
className: "text-3xl font-semibold text-[var(--color-text-primary)]",
|
|
113
|
+
children: T("auth.profile.myProfile", "My Profile")
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ _("p", {
|
|
116
|
+
className: "text-[var(--color-text-secondary)] mt-2",
|
|
117
|
+
children: T("auth.profile.viewAndManage", "View and manage your account information")
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ _(x, {
|
|
120
|
+
className: "mt-3",
|
|
121
|
+
children: T("auth.profile.purpose", "This is how you appear across the platform. Update your name, photo, and contact details here — teammates see this information, and we use your email for sign-in and important notices.")
|
|
122
|
+
})
|
|
123
|
+
]
|
|
113
124
|
}),
|
|
114
|
-
|
|
125
|
+
Q && /* @__PURE__ */ v("div", {
|
|
115
126
|
className: "mb-6 flex items-center gap-3 p-4 rounded-xl bg-[var(--color-status-success-bg-subtle)] border border-[var(--color-status-success-border)]",
|
|
116
127
|
children: [
|
|
117
128
|
/* @__PURE__ */ _(r, { className: "size-5 text-[var(--color-status-success-text)] flex-shrink-0" }),
|
|
118
129
|
/* @__PURE__ */ _("p", {
|
|
119
130
|
className: "text-[var(--color-status-success-text)]",
|
|
120
|
-
children:
|
|
131
|
+
children: Q
|
|
121
132
|
}),
|
|
122
133
|
/* @__PURE__ */ _("button", {
|
|
123
134
|
type: "button",
|
|
124
|
-
onClick: () =>
|
|
135
|
+
onClick: () => $(null),
|
|
125
136
|
className: "ml-auto text-sm text-[var(--color-status-success-text)] hover:underline transition-colors duration-200",
|
|
126
|
-
children:
|
|
137
|
+
children: T("auth.profile.dismiss", "Dismiss")
|
|
127
138
|
})
|
|
128
139
|
]
|
|
129
140
|
}),
|
|
130
|
-
|
|
141
|
+
X && /* @__PURE__ */ v("div", {
|
|
131
142
|
className: "mb-6 flex items-start gap-3 p-4 rounded-xl bg-[var(--color-status-error-bg-subtle)] border border-[var(--color-status-error-border)]",
|
|
132
143
|
children: [
|
|
133
144
|
/* @__PURE__ */ _(n, { className: "size-5 text-[var(--color-status-error-text)] flex-shrink-0 mt-0.5" }),
|
|
@@ -135,41 +146,41 @@ function x() {
|
|
|
135
146
|
className: "flex-1",
|
|
136
147
|
children: /* @__PURE__ */ _("p", {
|
|
137
148
|
className: "text-sm text-[var(--color-status-error-text)]",
|
|
138
|
-
children:
|
|
149
|
+
children: X
|
|
139
150
|
})
|
|
140
151
|
}),
|
|
141
152
|
/* @__PURE__ */ _("button", {
|
|
142
153
|
type: "button",
|
|
143
|
-
onClick: () =>
|
|
154
|
+
onClick: () => Z(null),
|
|
144
155
|
className: "text-sm text-[var(--color-status-error-text)] hover:underline transition-colors duration-200",
|
|
145
|
-
children:
|
|
156
|
+
children: T("auth.profile.dismiss", "Dismiss")
|
|
146
157
|
})
|
|
147
158
|
]
|
|
148
159
|
}),
|
|
149
160
|
/* @__PURE__ */ v("div", {
|
|
150
161
|
className: "rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] shadow-sm overflow-hidden",
|
|
151
162
|
children: [/* @__PURE__ */ _("div", {
|
|
152
|
-
className: "
|
|
163
|
+
className: "bg-accent-wash border-b border-border-seam p-6 text-text-primary",
|
|
153
164
|
children: /* @__PURE__ */ v("div", {
|
|
154
165
|
className: "flex items-center gap-4",
|
|
155
166
|
children: [/* @__PURE__ */ v("div", {
|
|
156
167
|
className: "relative group",
|
|
157
168
|
children: [
|
|
158
|
-
|
|
159
|
-
src:
|
|
160
|
-
alt:
|
|
169
|
+
k.avatar ? /* @__PURE__ */ _("img", {
|
|
170
|
+
src: k.avatar,
|
|
171
|
+
alt: T("auth.profile.avatarAlt", "Profile picture"),
|
|
161
172
|
className: "size-20 rounded-full object-cover shadow-lg"
|
|
162
173
|
}) : /* @__PURE__ */ _("div", {
|
|
163
|
-
className: "size-20 rounded-full bg-
|
|
164
|
-
children: (
|
|
174
|
+
className: "size-20 rounded-full bg-accent-soft backdrop-blur-sm flex items-center justify-center text-[var(--color-action-primary-bg)] text-3xl font-semibold shadow-lg",
|
|
175
|
+
children: (k.name || k.username || k.email).charAt(0).toUpperCase()
|
|
165
176
|
}),
|
|
166
177
|
/* @__PURE__ */ _("button", {
|
|
167
178
|
type: "button",
|
|
168
|
-
onClick: () =>
|
|
169
|
-
disabled:
|
|
170
|
-
"aria-label":
|
|
179
|
+
onClick: () => H.current?.click(),
|
|
180
|
+
disabled: U,
|
|
181
|
+
"aria-label": T("auth.profile.changeAvatar", "Change profile picture"),
|
|
171
182
|
className: "absolute inset-0 rounded-full flex items-center justify-center bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity duration-200 cursor-pointer",
|
|
172
|
-
children:
|
|
183
|
+
children: U ? /* @__PURE__ */ _(a, { className: "size-6 text-white animate-spin" }) : /* @__PURE__ */ v("svg", {
|
|
173
184
|
className: "size-6 text-white",
|
|
174
185
|
fill: "none",
|
|
175
186
|
viewBox: "0 0 24 24",
|
|
@@ -188,34 +199,34 @@ function x() {
|
|
|
188
199
|
})
|
|
189
200
|
}),
|
|
190
201
|
/* @__PURE__ */ _("input", {
|
|
191
|
-
ref:
|
|
202
|
+
ref: H,
|
|
192
203
|
type: "file",
|
|
193
204
|
accept: "image/*",
|
|
194
205
|
className: "hidden",
|
|
195
|
-
onChange: (e) => void
|
|
206
|
+
onChange: (e) => void G(e),
|
|
196
207
|
tabIndex: -1,
|
|
197
|
-
"aria-label":
|
|
208
|
+
"aria-label": T("auth.profile.avatarUpload", "Upload avatar image")
|
|
198
209
|
})
|
|
199
210
|
]
|
|
200
211
|
}), /* @__PURE__ */ v("div", {
|
|
201
|
-
className: "text-
|
|
212
|
+
className: "text-text-primary",
|
|
202
213
|
children: [
|
|
203
214
|
/* @__PURE__ */ _("h2", {
|
|
204
215
|
className: "text-2xl font-semibold",
|
|
205
|
-
children:
|
|
216
|
+
children: k.name || `${k.firstName || ""} ${k.lastName || ""}`.trim() || k.username
|
|
206
217
|
}),
|
|
207
218
|
/* @__PURE__ */ v("p", {
|
|
208
|
-
className: "text-
|
|
209
|
-
children: [/* @__PURE__ */ _(i, { className: "size-4" }),
|
|
219
|
+
className: "text-text-secondary flex items-center gap-2",
|
|
220
|
+
children: [/* @__PURE__ */ _(i, { className: "size-4" }), k.email]
|
|
210
221
|
}),
|
|
211
222
|
/* @__PURE__ */ v("div", {
|
|
212
223
|
className: "flex items-center gap-2 mt-2",
|
|
213
224
|
children: [/* @__PURE__ */ _("span", {
|
|
214
|
-
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-bg-surface/
|
|
215
|
-
children:
|
|
216
|
-
}),
|
|
217
|
-
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-status-success-text
|
|
218
|
-
children: [/* @__PURE__ */ _(r, { className: "size-3" }),
|
|
225
|
+
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-bg-surface/60 text-text-secondary backdrop-blur-sm",
|
|
226
|
+
children: k.role?.replace("_", " ") || T("auth.profile.member", "Member")
|
|
227
|
+
}), k.emailVerified && /* @__PURE__ */ v("span", {
|
|
228
|
+
className: "px-2.5 py-1 rounded-full text-xs font-medium bg-status-success-bg-subtle text-status-success-text flex items-center gap-1",
|
|
229
|
+
children: [/* @__PURE__ */ _(r, { className: "size-3" }), T("auth.profile.verified", "Verified")]
|
|
219
230
|
})]
|
|
220
231
|
})
|
|
221
232
|
]
|
|
@@ -223,19 +234,19 @@ function x() {
|
|
|
223
234
|
})
|
|
224
235
|
}), /* @__PURE__ */ _("div", {
|
|
225
236
|
className: "p-6",
|
|
226
|
-
children:
|
|
237
|
+
children: K ? /* @__PURE__ */ v("form", {
|
|
227
238
|
onSubmit: async (e) => {
|
|
228
|
-
e.preventDefault(),
|
|
239
|
+
e.preventDefault(), Z(null), $(null);
|
|
229
240
|
try {
|
|
230
|
-
await
|
|
231
|
-
username:
|
|
232
|
-
firstName:
|
|
233
|
-
lastName:
|
|
234
|
-
name:
|
|
235
|
-
phoneNumber:
|
|
236
|
-
}),
|
|
241
|
+
await j({
|
|
242
|
+
username: J.username || void 0,
|
|
243
|
+
firstName: J.firstName || void 0,
|
|
244
|
+
lastName: J.lastName || void 0,
|
|
245
|
+
name: J.name || void 0,
|
|
246
|
+
phoneNumber: J.phoneNumber || void 0
|
|
247
|
+
}), $(T("auth.profile.updateSuccess", "Profile updated successfully!")), q(!1);
|
|
237
248
|
} catch (e) {
|
|
238
|
-
|
|
249
|
+
Z(e instanceof Error ? e.message : T("auth.profile.updateFailed", "Failed to update profile"));
|
|
239
250
|
}
|
|
240
251
|
},
|
|
241
252
|
className: "space-y-6",
|
|
@@ -243,9 +254,9 @@ function x() {
|
|
|
243
254
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
244
255
|
children: [
|
|
245
256
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
246
|
-
htmlFor:
|
|
257
|
+
htmlFor: N,
|
|
247
258
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
248
|
-
children:
|
|
259
|
+
children: T("auth.profile.username", "Username")
|
|
249
260
|
}), /* @__PURE__ */ v("div", {
|
|
250
261
|
className: "relative",
|
|
251
262
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -255,106 +266,108 @@ function x() {
|
|
|
255
266
|
"aria-hidden": "true"
|
|
256
267
|
})
|
|
257
268
|
}), /* @__PURE__ */ _("input", {
|
|
258
|
-
id:
|
|
269
|
+
id: N,
|
|
259
270
|
type: "text",
|
|
260
|
-
"aria-label":
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
263
|
-
...
|
|
271
|
+
"aria-label": T("auth.profile.username", "Username"),
|
|
272
|
+
value: J.username,
|
|
273
|
+
onChange: (e) => Y({
|
|
274
|
+
...J,
|
|
264
275
|
username: e.target.value
|
|
265
276
|
}),
|
|
266
277
|
className: "block w-full pl-[3.5rem] pr-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
267
|
-
placeholder:
|
|
278
|
+
placeholder: T("auth.profile.usernamePlaceholder", "Enter username")
|
|
268
279
|
})]
|
|
269
280
|
})] }),
|
|
270
281
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
271
|
-
htmlFor:
|
|
282
|
+
htmlFor: P,
|
|
272
283
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
273
|
-
children:
|
|
284
|
+
children: T("auth.profile.displayName", "Display Name")
|
|
274
285
|
}), /* @__PURE__ */ _("input", {
|
|
275
|
-
id:
|
|
286
|
+
id: P,
|
|
276
287
|
type: "text",
|
|
277
|
-
"aria-label":
|
|
278
|
-
value:
|
|
279
|
-
onChange: (e) =>
|
|
280
|
-
...
|
|
288
|
+
"aria-label": T("auth.profile.displayName", "Display Name"),
|
|
289
|
+
value: J.name,
|
|
290
|
+
onChange: (e) => Y({
|
|
291
|
+
...J,
|
|
281
292
|
name: e.target.value
|
|
282
293
|
}),
|
|
283
294
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
284
|
-
placeholder:
|
|
295
|
+
placeholder: T("auth.profile.displayNamePlaceholder", "Enter display name")
|
|
285
296
|
})] }),
|
|
286
297
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
287
|
-
htmlFor:
|
|
298
|
+
htmlFor: F,
|
|
288
299
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
289
|
-
children:
|
|
300
|
+
children: T("auth.profile.firstName", "First Name")
|
|
290
301
|
}), /* @__PURE__ */ _("input", {
|
|
291
|
-
id:
|
|
302
|
+
id: F,
|
|
292
303
|
type: "text",
|
|
293
|
-
"aria-label":
|
|
294
|
-
value:
|
|
295
|
-
onChange: (e) =>
|
|
296
|
-
...
|
|
304
|
+
"aria-label": T("auth.profile.firstName", "First Name"),
|
|
305
|
+
value: J.firstName,
|
|
306
|
+
onChange: (e) => Y({
|
|
307
|
+
...J,
|
|
297
308
|
firstName: e.target.value
|
|
298
309
|
}),
|
|
299
310
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
300
|
-
placeholder:
|
|
311
|
+
placeholder: T("auth.profile.firstNamePlaceholder", "Enter first name")
|
|
301
312
|
})] }),
|
|
302
313
|
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
303
|
-
htmlFor:
|
|
314
|
+
htmlFor: I,
|
|
304
315
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
305
|
-
children:
|
|
316
|
+
children: T("auth.profile.lastName", "Last Name")
|
|
306
317
|
}), /* @__PURE__ */ _("input", {
|
|
307
|
-
id:
|
|
318
|
+
id: I,
|
|
308
319
|
type: "text",
|
|
309
|
-
"aria-label":
|
|
310
|
-
value:
|
|
311
|
-
onChange: (e) =>
|
|
312
|
-
...
|
|
320
|
+
"aria-label": T("auth.profile.lastName", "Last Name"),
|
|
321
|
+
value: J.lastName,
|
|
322
|
+
onChange: (e) => Y({
|
|
323
|
+
...J,
|
|
313
324
|
lastName: e.target.value
|
|
314
325
|
}),
|
|
315
326
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
316
|
-
placeholder:
|
|
327
|
+
placeholder: T("auth.profile.lastNamePlaceholder", "Enter last name")
|
|
317
328
|
})] }),
|
|
318
329
|
/* @__PURE__ */ v("div", {
|
|
319
330
|
className: "md:col-span-2",
|
|
320
331
|
children: [/* @__PURE__ */ _("label", {
|
|
321
|
-
htmlFor:
|
|
332
|
+
htmlFor: L,
|
|
322
333
|
className: "block text-sm font-medium text-[var(--color-text-primary)] mb-2",
|
|
323
|
-
children:
|
|
334
|
+
children: T("auth.profile.phoneNumber", "Phone Number")
|
|
324
335
|
}), /* @__PURE__ */ _("input", {
|
|
325
|
-
id:
|
|
336
|
+
id: L,
|
|
326
337
|
type: "tel",
|
|
327
|
-
"aria-label":
|
|
328
|
-
value:
|
|
329
|
-
onChange: (e) =>
|
|
330
|
-
...
|
|
338
|
+
"aria-label": T("auth.profile.phoneNumber", "Phone Number"),
|
|
339
|
+
value: J.phoneNumber,
|
|
340
|
+
onChange: (e) => Y({
|
|
341
|
+
...J,
|
|
331
342
|
phoneNumber: e.target.value
|
|
332
343
|
}),
|
|
333
344
|
className: "block w-full px-4 py-3 border border-[var(--color-border-default)] rounded-xl bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all duration-300",
|
|
334
|
-
placeholder:
|
|
345
|
+
placeholder: T("auth.profile.phonePlaceholder", "Enter phone number")
|
|
335
346
|
})]
|
|
336
347
|
})
|
|
337
348
|
]
|
|
338
349
|
}), /* @__PURE__ */ v("div", {
|
|
339
350
|
className: "flex gap-3 pt-4 border-t border-[var(--color-border-default)]",
|
|
340
|
-
children: [/* @__PURE__ */ _(
|
|
351
|
+
children: [/* @__PURE__ */ _(y, {
|
|
341
352
|
type: "submit",
|
|
342
|
-
disabled:
|
|
343
|
-
|
|
344
|
-
|
|
353
|
+
disabled: M,
|
|
354
|
+
variant: "default",
|
|
355
|
+
size: "lg",
|
|
356
|
+
className: "font-semibold",
|
|
357
|
+
children: M ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(a, { className: "size-4 animate-spin" }), T("auth.profile.saving", "Saving...")] }) : T("auth.profile.saveChanges", "Save Changes")
|
|
345
358
|
}), /* @__PURE__ */ _("button", {
|
|
346
359
|
type: "button",
|
|
347
360
|
onClick: () => {
|
|
348
|
-
|
|
349
|
-
username:
|
|
350
|
-
firstName:
|
|
351
|
-
lastName:
|
|
352
|
-
name:
|
|
353
|
-
phoneNumber:
|
|
354
|
-
}),
|
|
361
|
+
k && Y({
|
|
362
|
+
username: k.username || "",
|
|
363
|
+
firstName: k.firstName || "",
|
|
364
|
+
lastName: k.lastName || "",
|
|
365
|
+
name: k.name || "",
|
|
366
|
+
phoneNumber: k.phoneNumber || ""
|
|
367
|
+
}), q(!1), Z(null);
|
|
355
368
|
},
|
|
356
369
|
className: "px-6 py-3 rounded-xl border border-[var(--color-border-default)] text-[var(--color-text-secondary)] font-medium hover:bg-[var(--color-bg-muted)] transition-colors duration-200",
|
|
357
|
-
children:
|
|
370
|
+
children: T("auth.profile.cancel", "Cancel")
|
|
358
371
|
})]
|
|
359
372
|
})]
|
|
360
373
|
}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
@@ -364,52 +377,52 @@ function x() {
|
|
|
364
377
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
365
378
|
children: [/* @__PURE__ */ _("label", {
|
|
366
379
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
367
|
-
children:
|
|
380
|
+
children: T("auth.profile.username", "Username")
|
|
368
381
|
}), /* @__PURE__ */ _("p", {
|
|
369
382
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
370
|
-
children:
|
|
383
|
+
children: k.username || "-"
|
|
371
384
|
})]
|
|
372
385
|
}),
|
|
373
386
|
/* @__PURE__ */ v("div", {
|
|
374
387
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
375
388
|
children: [/* @__PURE__ */ _("label", {
|
|
376
389
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
377
|
-
children:
|
|
390
|
+
children: T("auth.profile.displayName", "Display Name")
|
|
378
391
|
}), /* @__PURE__ */ _("p", {
|
|
379
392
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
380
|
-
children:
|
|
393
|
+
children: k.name || "-"
|
|
381
394
|
})]
|
|
382
395
|
}),
|
|
383
396
|
/* @__PURE__ */ v("div", {
|
|
384
397
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
385
398
|
children: [/* @__PURE__ */ _("label", {
|
|
386
399
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
387
|
-
children:
|
|
400
|
+
children: T("auth.profile.firstName", "First Name")
|
|
388
401
|
}), /* @__PURE__ */ _("p", {
|
|
389
402
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
390
|
-
children:
|
|
403
|
+
children: k.firstName || "-"
|
|
391
404
|
})]
|
|
392
405
|
}),
|
|
393
406
|
/* @__PURE__ */ v("div", {
|
|
394
407
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
395
408
|
children: [/* @__PURE__ */ _("label", {
|
|
396
409
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
397
|
-
children:
|
|
410
|
+
children: T("auth.profile.lastName", "Last Name")
|
|
398
411
|
}), /* @__PURE__ */ _("p", {
|
|
399
412
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
400
|
-
children:
|
|
413
|
+
children: k.lastName || "-"
|
|
401
414
|
})]
|
|
402
415
|
}),
|
|
403
416
|
/* @__PURE__ */ v("div", {
|
|
404
417
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
405
418
|
children: [/* @__PURE__ */ _("label", {
|
|
406
419
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
407
|
-
children:
|
|
420
|
+
children: T("auth.profile.email", "Email")
|
|
408
421
|
}), /* @__PURE__ */ v("p", {
|
|
409
422
|
className: "text-[var(--color-text-primary)] font-medium flex items-center gap-2",
|
|
410
|
-
children: [
|
|
423
|
+
children: [k.email, k.emailVerified && /* @__PURE__ */ v("span", {
|
|
411
424
|
className: "inline-flex items-center gap-1 text-[var(--color-status-success-text)] text-xs",
|
|
412
|
-
children: [/* @__PURE__ */ _(r, { className: "size-3" }),
|
|
425
|
+
children: [/* @__PURE__ */ _(r, { className: "size-3" }), T("auth.profile.verified", "Verified")]
|
|
413
426
|
})]
|
|
414
427
|
})]
|
|
415
428
|
}),
|
|
@@ -417,35 +430,35 @@ function x() {
|
|
|
417
430
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
418
431
|
children: [/* @__PURE__ */ _("label", {
|
|
419
432
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
420
|
-
children:
|
|
433
|
+
children: T("auth.profile.phoneNumber", "Phone Number")
|
|
421
434
|
}), /* @__PURE__ */ _("p", {
|
|
422
435
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
423
|
-
children:
|
|
436
|
+
children: k.phoneNumber || "-"
|
|
424
437
|
})]
|
|
425
438
|
}),
|
|
426
439
|
/* @__PURE__ */ v("div", {
|
|
427
440
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
428
441
|
children: [/* @__PURE__ */ _("label", {
|
|
429
442
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
430
|
-
children:
|
|
443
|
+
children: T("auth.profile.role", "Role")
|
|
431
444
|
}), /* @__PURE__ */ _("p", {
|
|
432
445
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
433
|
-
children:
|
|
446
|
+
children: k.role?.replace("_", " ") || T("auth.profile.member", "Member")
|
|
434
447
|
})]
|
|
435
448
|
}),
|
|
436
449
|
/* @__PURE__ */ v("div", {
|
|
437
450
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
438
451
|
children: [/* @__PURE__ */ _("label", {
|
|
439
452
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
440
|
-
children:
|
|
453
|
+
children: T("auth.profile.mfaStatus", "MFA Status")
|
|
441
454
|
}), /* @__PURE__ */ _("p", {
|
|
442
455
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
443
|
-
children:
|
|
456
|
+
children: k.mfaEnabled ? /* @__PURE__ */ v("span", {
|
|
444
457
|
className: "text-[var(--color-status-success-text)] flex items-center gap-1",
|
|
445
|
-
children: [/* @__PURE__ */ _(r, { className: "size-4" }),
|
|
458
|
+
children: [/* @__PURE__ */ _(r, { className: "size-4" }), T("auth.profile.enabled", "Enabled")]
|
|
446
459
|
}) : /* @__PURE__ */ _("span", {
|
|
447
460
|
className: "text-[var(--color-status-warning-text)]",
|
|
448
|
-
children:
|
|
461
|
+
children: T("auth.profile.notEnabled", "Not Enabled")
|
|
449
462
|
})
|
|
450
463
|
})]
|
|
451
464
|
}),
|
|
@@ -453,44 +466,72 @@ function x() {
|
|
|
453
466
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
454
467
|
children: [/* @__PURE__ */ _("label", {
|
|
455
468
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
456
|
-
children:
|
|
469
|
+
children: T("auth.profile.lastLogin", "Last Login")
|
|
457
470
|
}), /* @__PURE__ */ _("p", {
|
|
458
471
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
459
|
-
children:
|
|
472
|
+
children: k.lastLoginAt ? new Date(k.lastLoginAt).toLocaleString() : T("auth.profile.never", "Never")
|
|
460
473
|
})]
|
|
461
474
|
}),
|
|
462
475
|
/* @__PURE__ */ v("div", {
|
|
463
476
|
className: "p-4 rounded-xl bg-[var(--color-bg-muted)]",
|
|
464
477
|
children: [/* @__PURE__ */ _("label", {
|
|
465
478
|
className: "block text-sm font-medium text-[var(--color-text-tertiary)] mb-1",
|
|
466
|
-
children:
|
|
479
|
+
children: T("auth.profile.accountCreated", "Account Created")
|
|
467
480
|
}), /* @__PURE__ */ _("p", {
|
|
468
481
|
className: "text-[var(--color-text-primary)] font-medium",
|
|
469
|
-
children:
|
|
482
|
+
children: k.createdAt ? new Date(k.createdAt).toLocaleString() : "-"
|
|
470
483
|
})]
|
|
471
484
|
})
|
|
472
485
|
]
|
|
473
486
|
}), /* @__PURE__ */ v("div", {
|
|
474
487
|
className: "flex gap-3 pt-6 mt-6 border-t border-[var(--color-border-default)]",
|
|
475
|
-
children: [/* @__PURE__ */ _(
|
|
488
|
+
children: [/* @__PURE__ */ _(y, {
|
|
476
489
|
type: "button",
|
|
477
|
-
onClick: () =>
|
|
478
|
-
|
|
479
|
-
|
|
490
|
+
onClick: () => q(!0),
|
|
491
|
+
variant: "default",
|
|
492
|
+
size: "lg",
|
|
493
|
+
className: "font-semibold",
|
|
494
|
+
children: T("auth.profile.editProfile", "Edit Profile")
|
|
480
495
|
}), /* @__PURE__ */ _("button", {
|
|
481
496
|
type: "button",
|
|
482
|
-
onClick: () =>
|
|
497
|
+
onClick: () => E("/auth/security"),
|
|
483
498
|
className: "px-6 py-3 rounded-xl border border-[var(--color-border-default)] text-[var(--color-text-secondary)] font-medium hover:bg-[var(--color-bg-muted)] transition-colors duration-200",
|
|
484
|
-
children:
|
|
499
|
+
children: T("auth.profile.securitySettings", "Security Settings")
|
|
485
500
|
})]
|
|
486
501
|
})] })
|
|
487
502
|
})]
|
|
488
503
|
}),
|
|
504
|
+
/* @__PURE__ */ _(b, {
|
|
505
|
+
className: "mt-8",
|
|
506
|
+
storageKey: "auth-profile",
|
|
507
|
+
steps: [
|
|
508
|
+
{
|
|
509
|
+
id: "edit-profile",
|
|
510
|
+
label: T("auth.profile.nextEdit", "Complete your profile"),
|
|
511
|
+
description: T("auth.profile.nextEditDesc", "Add your display name and photo so teammates recognise you."),
|
|
512
|
+
onClick: () => q(!0),
|
|
513
|
+
done: !!(k.name && k.avatar)
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
id: "enable-mfa",
|
|
517
|
+
label: T("auth.profile.nextMfa", "Secure your account with 2FA"),
|
|
518
|
+
description: T("auth.profile.nextMfaDesc", "Turn on two-factor authentication for stronger protection."),
|
|
519
|
+
onClick: () => E("/auth/mfa"),
|
|
520
|
+
done: !!k.mfaEnabled
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
id: "security-center",
|
|
524
|
+
label: T("auth.profile.nextSecurity", "Visit the Security Center"),
|
|
525
|
+
description: T("auth.profile.nextSecurityDesc", "Review sessions, password, and account options."),
|
|
526
|
+
onClick: () => E("/auth/security")
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
}),
|
|
489
530
|
/* @__PURE__ */ v("div", {
|
|
490
531
|
className: "mt-8 grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
491
532
|
children: [/* @__PURE__ */ v("button", {
|
|
492
533
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
534
|
+
onClick: () => E("/auth/mfa"),
|
|
494
535
|
className: "p-4 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:border-[var(--color-action-primary-border)] transition-colors duration-200 text-left group",
|
|
495
536
|
children: [
|
|
496
537
|
/* @__PURE__ */ _("div", {
|
|
@@ -510,16 +551,16 @@ function x() {
|
|
|
510
551
|
}),
|
|
511
552
|
/* @__PURE__ */ _("h3", {
|
|
512
553
|
className: "font-medium text-[var(--color-text-primary)]",
|
|
513
|
-
children:
|
|
554
|
+
children: T("auth.profile.twoFactorAuth", "Two-Factor Auth")
|
|
514
555
|
}),
|
|
515
556
|
/* @__PURE__ */ _("p", {
|
|
516
557
|
className: "text-sm text-[var(--color-text-tertiary)] mt-1",
|
|
517
|
-
children:
|
|
558
|
+
children: k.mfaEnabled ? T("auth.profile.manageMfa", "Manage MFA settings") : T("auth.profile.enableMfa", "Enable MFA for extra security")
|
|
518
559
|
})
|
|
519
560
|
]
|
|
520
561
|
}), /* @__PURE__ */ v("button", {
|
|
521
562
|
type: "button",
|
|
522
|
-
onClick: () =>
|
|
563
|
+
onClick: () => E("/devportal/api-keys"),
|
|
523
564
|
className: "p-4 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:border-[var(--color-action-secondary-border)] transition-colors duration-200 text-left group",
|
|
524
565
|
children: [
|
|
525
566
|
/* @__PURE__ */ _("div", {
|
|
@@ -539,11 +580,11 @@ function x() {
|
|
|
539
580
|
}),
|
|
540
581
|
/* @__PURE__ */ _("h3", {
|
|
541
582
|
className: "font-medium text-[var(--color-text-primary)]",
|
|
542
|
-
children:
|
|
583
|
+
children: T("auth.profile.apiKeys", "API Keys")
|
|
543
584
|
}),
|
|
544
585
|
/* @__PURE__ */ _("p", {
|
|
545
586
|
className: "text-sm text-[var(--color-text-tertiary)] mt-1",
|
|
546
|
-
children:
|
|
587
|
+
children: T("auth.profile.manageApiKeys", "Manage your API access credentials")
|
|
547
588
|
})
|
|
548
589
|
]
|
|
549
590
|
})]
|
|
@@ -552,6 +593,6 @@ function x() {
|
|
|
552
593
|
});
|
|
553
594
|
}
|
|
554
595
|
//#endregion
|
|
555
|
-
export {
|
|
596
|
+
export { w as UserProfilePage };
|
|
556
597
|
|
|
557
598
|
//# sourceMappingURL=UserProfilePage.js.map
|