@byline/host-tanstack-start 6.7.2 → 6.8.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/dist/admin-shell/admin-roles/container_module.css +1 -1
- package/dist/admin-shell/admin-roles/delete.js +1 -1
- package/dist/admin-shell/admin-users/container.js +181 -159
- package/dist/admin-shell/admin-users/container.module.js +2 -1
- package/dist/admin-shell/admin-users/container_module.css +5 -1
- package/dist/admin-shell/admin-users/delete.js +1 -1
- package/dist/integrations/byline-admin-services.js +2 -0
- package/dist/integrations/passkey-admin-services.d.ts +9 -0
- package/dist/integrations/passkey-admin-services.js +53 -0
- package/dist/integrations/session-coordination.d.ts +3 -1
- package/dist/integrations/session-coordination.js +3 -1
- package/dist/integrations/session-middleware.d.ts +3 -1
- package/dist/integrations/session-middleware.js +87 -79
- package/dist/integrations/sign-in-body.d.ts +3 -0
- package/dist/integrations/sign-in-body.js +19 -4
- package/dist/integrations/sign-in-middleware.js +30 -5
- package/dist/server-fns/auth/passkey-admission.d.ts +24 -0
- package/dist/server-fns/auth/passkey-admission.js +88 -0
- package/dist/server-fns/auth/passkeys.d.ts +96 -0
- package/dist/server-fns/auth/passkeys.js +238 -0
- package/dist/server-fns/auth/reconcile-locale.d.ts +20 -0
- package/dist/server-fns/auth/reconcile-locale.js +16 -0
- package/dist/server-fns/auth/sign-in.js +1 -15
- package/package.json +11 -11
- package/src/admin-shell/admin-roles/container.module.css +1 -1
- package/src/admin-shell/admin-roles/delete.tsx +1 -1
- package/src/admin-shell/admin-users/container.module.css +7 -1
- package/src/admin-shell/admin-users/container.tsx +22 -2
- package/src/admin-shell/admin-users/delete.tsx +1 -1
- package/src/integrations/byline-admin-services.ts +3 -0
- package/src/integrations/passkey-admin-services.ts +85 -0
- package/src/integrations/session-client.test.node.ts +73 -0
- package/src/integrations/session-coordination.ts +3 -1
- package/src/integrations/session-middleware.ts +86 -72
- package/src/integrations/sign-in-body.test.node.ts +31 -1
- package/src/integrations/sign-in-body.ts +27 -3
- package/src/integrations/sign-in-middleware.ts +42 -9
- package/src/server-fns/auth/passkey-admission.test.node.ts +173 -0
- package/src/server-fns/auth/passkey-admission.ts +125 -0
- package/src/server-fns/auth/passkeys.test.node.ts +247 -0
- package/src/server-fns/auth/passkeys.ts +252 -0
- package/src/server-fns/auth/reconcile-locale.ts +40 -0
- package/src/server-fns/auth/sign-in.ts +1 -32
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:is(.card-glD1iI, .byline-role-detail-card) {
|
|
2
2
|
border: var(--border-width-thin) var(--border-style-solid) var(--gray-100);
|
|
3
|
+
border-radius: var(--border-radius-sm);
|
|
3
4
|
background-color: var(--canvas-25);
|
|
4
|
-
border-radius: .125rem;
|
|
5
5
|
margin-bottom: 1.5rem;
|
|
6
6
|
padding: 1rem;
|
|
7
7
|
}
|
|
@@ -5,10 +5,13 @@ import { useRouter } from "@tanstack/react-router";
|
|
|
5
5
|
import { UserRoles } from "@byline/admin/admin-users/components/roles";
|
|
6
6
|
import { SetPassword } from "@byline/admin/admin-users/components/set-password";
|
|
7
7
|
import { UpdateUser } from "@byline/admin/admin-users/components/update";
|
|
8
|
+
import { PasskeyManager } from "@byline/admin/auth/components/passkey-manager";
|
|
8
9
|
import { LocalDateTime } from "@byline/admin/react";
|
|
9
10
|
import { useTranslation } from "@byline/i18n/react";
|
|
10
11
|
import { Button, CloseIcon, Drawer, EditIcon, IconButton, Modal, useToastManager } from "@byline/ui/react";
|
|
11
12
|
import clsx from "clsx";
|
|
13
|
+
import { getAdminRoutePath } from "../../routes/admin-path.js";
|
|
14
|
+
import { Link } from "../chrome/loose-router.js";
|
|
12
15
|
import container_module from "./container.module.js";
|
|
13
16
|
import { DeleteUser } from "./delete.js";
|
|
14
17
|
const panelMeta = {
|
|
@@ -125,167 +128,164 @@ function AccountContainer({ user, allRoles, initialUserRoles }) {
|
|
|
125
128
|
/*#__PURE__*/ jsxs("div", {
|
|
126
129
|
className: clsx('byline-admin-user-grid', container_module.grid),
|
|
127
130
|
children: [
|
|
128
|
-
/*#__PURE__*/ jsx("div", {
|
|
129
|
-
className: clsx('byline-admin-user-column', container_module.column),
|
|
130
|
-
children: /*#__PURE__*/ jsxs(ContainerSection, {
|
|
131
|
-
title: t('adminUsers.detail.sections.account'),
|
|
132
|
-
onEdit: openDrawer('update'),
|
|
133
|
-
editAriaLabel: editAriaFor(t('adminUsers.detail.sections.account')),
|
|
134
|
-
children: [
|
|
135
|
-
/*#__PURE__*/ jsxs("p", {
|
|
136
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
137
|
-
children: [
|
|
138
|
-
/*#__PURE__*/ jsx("span", {
|
|
139
|
-
className: "muted",
|
|
140
|
-
children: t('account.profile.emailColon')
|
|
141
|
-
}),
|
|
142
|
-
" ",
|
|
143
|
-
currentUser.email
|
|
144
|
-
]
|
|
145
|
-
}),
|
|
146
|
-
/*#__PURE__*/ jsxs("p", {
|
|
147
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
148
|
-
children: [
|
|
149
|
-
/*#__PURE__*/ jsx("span", {
|
|
150
|
-
className: "muted",
|
|
151
|
-
children: t('account.profile.givenName')
|
|
152
|
-
}),
|
|
153
|
-
' ',
|
|
154
|
-
currentUser.given_name ?? /*#__PURE__*/ jsx("span", {
|
|
155
|
-
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
156
|
-
children: t('common.notSet')
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
}),
|
|
160
|
-
/*#__PURE__*/ jsxs("p", {
|
|
161
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
162
|
-
children: [
|
|
163
|
-
/*#__PURE__*/ jsx("span", {
|
|
164
|
-
className: "muted",
|
|
165
|
-
children: t('account.profile.familyName')
|
|
166
|
-
}),
|
|
167
|
-
' ',
|
|
168
|
-
currentUser.family_name ?? /*#__PURE__*/ jsx("span", {
|
|
169
|
-
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
170
|
-
children: t('common.notSet')
|
|
171
|
-
})
|
|
172
|
-
]
|
|
173
|
-
}),
|
|
174
|
-
/*#__PURE__*/ jsxs("p", {
|
|
175
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
176
|
-
children: [
|
|
177
|
-
/*#__PURE__*/ jsx("span", {
|
|
178
|
-
className: "muted",
|
|
179
|
-
children: t('account.profile.username')
|
|
180
|
-
}),
|
|
181
|
-
' ',
|
|
182
|
-
currentUser.username ?? /*#__PURE__*/ jsx("span", {
|
|
183
|
-
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
184
|
-
children: t('common.notSet')
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
}),
|
|
188
|
-
/*#__PURE__*/ jsxs("p", {
|
|
189
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
190
|
-
children: [
|
|
191
|
-
/*#__PURE__*/ jsx("span", {
|
|
192
|
-
className: "muted",
|
|
193
|
-
children: t('account.status.superAdmin')
|
|
194
|
-
}),
|
|
195
|
-
' ',
|
|
196
|
-
currentUser.is_super_admin ? t('common.boolean.yes') : t('common.boolean.no')
|
|
197
|
-
]
|
|
198
|
-
}),
|
|
199
|
-
/*#__PURE__*/ jsxs("p", {
|
|
200
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
201
|
-
children: [
|
|
202
|
-
/*#__PURE__*/ jsx("span", {
|
|
203
|
-
className: "muted",
|
|
204
|
-
children: t('account.status.emailVerified')
|
|
205
|
-
}),
|
|
206
|
-
' ',
|
|
207
|
-
currentUser.is_email_verified ? t('common.boolean.yes') : t('common.boolean.no')
|
|
208
|
-
]
|
|
209
|
-
}),
|
|
210
|
-
/*#__PURE__*/ jsxs("p", {
|
|
211
|
-
className: clsx('byline-admin-user-line-spaced', container_module.lineSpaced),
|
|
212
|
-
children: [
|
|
213
|
-
/*#__PURE__*/ jsx("span", {
|
|
214
|
-
className: "muted",
|
|
215
|
-
children: t('account.status.status')
|
|
216
|
-
}),
|
|
217
|
-
' ',
|
|
218
|
-
/*#__PURE__*/ jsx("span", {
|
|
219
|
-
className: clsx({
|
|
220
|
-
'byline-admin-user-status-on': currentUser.is_enabled,
|
|
221
|
-
[container_module.statusOn]: currentUser.is_enabled,
|
|
222
|
-
'byline-admin-user-status-off': !currentUser.is_enabled,
|
|
223
|
-
[container_module.statusOff]: !currentUser.is_enabled
|
|
224
|
-
}),
|
|
225
|
-
children: currentUser.is_enabled ? t('account.status.enabled') : t('account.status.disabled')
|
|
226
|
-
})
|
|
227
|
-
]
|
|
228
|
-
}),
|
|
229
|
-
/*#__PURE__*/ jsx(Button, {
|
|
230
|
-
size: "sm",
|
|
231
|
-
onClick: openDrawer('update'),
|
|
232
|
-
children: t('adminUsers.detail.updateButton')
|
|
233
|
-
}),
|
|
234
|
-
/*#__PURE__*/ jsxs("div", {
|
|
235
|
-
className: clsx('muted byline-admin-user-meta', container_module.meta),
|
|
236
|
-
children: [
|
|
237
|
-
/*#__PURE__*/ jsxs("p", {
|
|
238
|
-
children: [
|
|
239
|
-
/*#__PURE__*/ jsxs("span", {
|
|
240
|
-
className: "font-bold",
|
|
241
|
-
children: [
|
|
242
|
-
t('account.profile.created'),
|
|
243
|
-
"\xa0"
|
|
244
|
-
]
|
|
245
|
-
}),
|
|
246
|
-
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
247
|
-
value: currentUser.created_at
|
|
248
|
-
})
|
|
249
|
-
]
|
|
250
|
-
}),
|
|
251
|
-
/*#__PURE__*/ jsxs("p", {
|
|
252
|
-
children: [
|
|
253
|
-
/*#__PURE__*/ jsxs("span", {
|
|
254
|
-
className: "font-bold",
|
|
255
|
-
children: [
|
|
256
|
-
t('account.profile.updated'),
|
|
257
|
-
"\xa0"
|
|
258
|
-
]
|
|
259
|
-
}),
|
|
260
|
-
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
261
|
-
value: currentUser.updated_at
|
|
262
|
-
})
|
|
263
|
-
]
|
|
264
|
-
}),
|
|
265
|
-
/*#__PURE__*/ jsxs("p", {
|
|
266
|
-
className: clsx('byline-admin-user-line', container_module.line),
|
|
267
|
-
children: [
|
|
268
|
-
/*#__PURE__*/ jsxs("span", {
|
|
269
|
-
className: "font-bold",
|
|
270
|
-
children: [
|
|
271
|
-
t('account.profile.lastLogin'),
|
|
272
|
-
"\xa0"
|
|
273
|
-
]
|
|
274
|
-
}),
|
|
275
|
-
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
276
|
-
value: currentUser.last_login,
|
|
277
|
-
fallback: t('common.never')
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
})
|
|
283
|
-
]
|
|
284
|
-
})
|
|
285
|
-
}),
|
|
286
131
|
/*#__PURE__*/ jsxs("div", {
|
|
287
132
|
className: clsx('byline-admin-user-column', container_module.column),
|
|
288
133
|
children: [
|
|
134
|
+
/*#__PURE__*/ jsxs(ContainerSection, {
|
|
135
|
+
title: t('adminUsers.detail.sections.account'),
|
|
136
|
+
onEdit: openDrawer('update'),
|
|
137
|
+
editAriaLabel: editAriaFor(t('adminUsers.detail.sections.account')),
|
|
138
|
+
children: [
|
|
139
|
+
/*#__PURE__*/ jsxs("p", {
|
|
140
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
141
|
+
children: [
|
|
142
|
+
/*#__PURE__*/ jsx("span", {
|
|
143
|
+
className: "muted",
|
|
144
|
+
children: t('account.profile.emailColon')
|
|
145
|
+
}),
|
|
146
|
+
" ",
|
|
147
|
+
currentUser.email
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
/*#__PURE__*/ jsxs("p", {
|
|
151
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
152
|
+
children: [
|
|
153
|
+
/*#__PURE__*/ jsx("span", {
|
|
154
|
+
className: "muted",
|
|
155
|
+
children: t('account.profile.givenName')
|
|
156
|
+
}),
|
|
157
|
+
' ',
|
|
158
|
+
currentUser.given_name ?? /*#__PURE__*/ jsx("span", {
|
|
159
|
+
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
160
|
+
children: t('common.notSet')
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}),
|
|
164
|
+
/*#__PURE__*/ jsxs("p", {
|
|
165
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
166
|
+
children: [
|
|
167
|
+
/*#__PURE__*/ jsx("span", {
|
|
168
|
+
className: "muted",
|
|
169
|
+
children: t('account.profile.familyName')
|
|
170
|
+
}),
|
|
171
|
+
' ',
|
|
172
|
+
currentUser.family_name ?? /*#__PURE__*/ jsx("span", {
|
|
173
|
+
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
174
|
+
children: t('common.notSet')
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
/*#__PURE__*/ jsxs("p", {
|
|
179
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
180
|
+
children: [
|
|
181
|
+
/*#__PURE__*/ jsx("span", {
|
|
182
|
+
className: "muted",
|
|
183
|
+
children: t('account.profile.username')
|
|
184
|
+
}),
|
|
185
|
+
' ',
|
|
186
|
+
currentUser.username ?? /*#__PURE__*/ jsx("span", {
|
|
187
|
+
className: clsx('muted byline-admin-user-not-set', container_module.notSet),
|
|
188
|
+
children: t('common.notSet')
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}),
|
|
192
|
+
/*#__PURE__*/ jsxs("p", {
|
|
193
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
194
|
+
children: [
|
|
195
|
+
/*#__PURE__*/ jsx("span", {
|
|
196
|
+
className: "muted",
|
|
197
|
+
children: t('account.status.superAdmin')
|
|
198
|
+
}),
|
|
199
|
+
' ',
|
|
200
|
+
currentUser.is_super_admin ? t('common.boolean.yes') : t('common.boolean.no')
|
|
201
|
+
]
|
|
202
|
+
}),
|
|
203
|
+
/*#__PURE__*/ jsxs("p", {
|
|
204
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
205
|
+
children: [
|
|
206
|
+
/*#__PURE__*/ jsx("span", {
|
|
207
|
+
className: "muted",
|
|
208
|
+
children: t('account.status.emailVerified')
|
|
209
|
+
}),
|
|
210
|
+
' ',
|
|
211
|
+
currentUser.is_email_verified ? t('common.boolean.yes') : t('common.boolean.no')
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
/*#__PURE__*/ jsxs("p", {
|
|
215
|
+
className: clsx('byline-admin-user-line-spaced', container_module.lineSpaced),
|
|
216
|
+
children: [
|
|
217
|
+
/*#__PURE__*/ jsx("span", {
|
|
218
|
+
className: "muted",
|
|
219
|
+
children: t('account.status.status')
|
|
220
|
+
}),
|
|
221
|
+
' ',
|
|
222
|
+
/*#__PURE__*/ jsx("span", {
|
|
223
|
+
className: clsx({
|
|
224
|
+
'byline-admin-user-status-on': currentUser.is_enabled,
|
|
225
|
+
[container_module.statusOn]: currentUser.is_enabled,
|
|
226
|
+
'byline-admin-user-status-off': !currentUser.is_enabled,
|
|
227
|
+
[container_module.statusOff]: !currentUser.is_enabled
|
|
228
|
+
}),
|
|
229
|
+
children: currentUser.is_enabled ? t('account.status.enabled') : t('account.status.disabled')
|
|
230
|
+
})
|
|
231
|
+
]
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ jsx(Button, {
|
|
234
|
+
size: "sm",
|
|
235
|
+
onClick: openDrawer('update'),
|
|
236
|
+
children: t('adminUsers.detail.updateButton')
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ jsxs("div", {
|
|
239
|
+
className: clsx('muted byline-admin-user-meta', container_module.meta),
|
|
240
|
+
children: [
|
|
241
|
+
/*#__PURE__*/ jsxs("p", {
|
|
242
|
+
children: [
|
|
243
|
+
/*#__PURE__*/ jsxs("span", {
|
|
244
|
+
className: "font-bold",
|
|
245
|
+
children: [
|
|
246
|
+
t('account.profile.created'),
|
|
247
|
+
"\xa0"
|
|
248
|
+
]
|
|
249
|
+
}),
|
|
250
|
+
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
251
|
+
value: currentUser.created_at
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
}),
|
|
255
|
+
/*#__PURE__*/ jsxs("p", {
|
|
256
|
+
children: [
|
|
257
|
+
/*#__PURE__*/ jsxs("span", {
|
|
258
|
+
className: "font-bold",
|
|
259
|
+
children: [
|
|
260
|
+
t('account.profile.updated'),
|
|
261
|
+
"\xa0"
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
265
|
+
value: currentUser.updated_at
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}),
|
|
269
|
+
/*#__PURE__*/ jsxs("p", {
|
|
270
|
+
className: clsx('byline-admin-user-line', container_module.line),
|
|
271
|
+
children: [
|
|
272
|
+
/*#__PURE__*/ jsxs("span", {
|
|
273
|
+
className: "font-bold",
|
|
274
|
+
children: [
|
|
275
|
+
t('account.profile.lastLogin'),
|
|
276
|
+
"\xa0"
|
|
277
|
+
]
|
|
278
|
+
}),
|
|
279
|
+
/*#__PURE__*/ jsx(LocalDateTime, {
|
|
280
|
+
value: currentUser.last_login,
|
|
281
|
+
fallback: t('common.never')
|
|
282
|
+
})
|
|
283
|
+
]
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
})
|
|
287
|
+
]
|
|
288
|
+
}),
|
|
289
289
|
/*#__PURE__*/ jsxs(ContainerSection, {
|
|
290
290
|
title: t('adminUsers.detail.sections.roles'),
|
|
291
291
|
onEdit: openDrawer('roles'),
|
|
@@ -306,7 +306,12 @@ function AccountContainer({ user, allRoles, initialUserRoles }) {
|
|
|
306
306
|
children: t('adminUsers.detail.editRolesButton')
|
|
307
307
|
})
|
|
308
308
|
]
|
|
309
|
-
})
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
}),
|
|
312
|
+
/*#__PURE__*/ jsxs("div", {
|
|
313
|
+
className: clsx('byline-admin-user-column', container_module.column),
|
|
314
|
+
children: [
|
|
310
315
|
/*#__PURE__*/ jsxs(ContainerSection, {
|
|
311
316
|
title: t('adminUsers.detail.sections.password'),
|
|
312
317
|
onEdit: openDrawer('set_password'),
|
|
@@ -323,6 +328,23 @@ function AccountContainer({ user, allRoles, initialUserRoles }) {
|
|
|
323
328
|
})
|
|
324
329
|
]
|
|
325
330
|
}),
|
|
331
|
+
/*#__PURE__*/ jsx(PasskeyManager, {
|
|
332
|
+
targetUserId: currentUser.id,
|
|
333
|
+
targetIsSuperAdmin: currentUser.is_super_admin,
|
|
334
|
+
section: ContainerSection,
|
|
335
|
+
ownAccountNotice: /*#__PURE__*/ jsxs("p", {
|
|
336
|
+
className: clsx('byline-admin-user-line-spaced', container_module.lineSpaced),
|
|
337
|
+
children: [
|
|
338
|
+
t('adminUsers.detail.passkeys.ownAccount'),
|
|
339
|
+
' ',
|
|
340
|
+
/*#__PURE__*/ jsx(Link, {
|
|
341
|
+
to: getAdminRoutePath('account'),
|
|
342
|
+
className: clsx('byline-admin-user-account-link', container_module.accountLink),
|
|
343
|
+
children: t('adminUsers.detail.passkeys.openAccount')
|
|
344
|
+
})
|
|
345
|
+
]
|
|
346
|
+
})
|
|
347
|
+
}),
|
|
326
348
|
/*#__PURE__*/ jsxs(ContainerSection, {
|
|
327
349
|
title: t('adminUsers.detail.sections.delete'),
|
|
328
350
|
children: [
|
|
@@ -17,6 +17,7 @@ const container_module = {
|
|
|
17
17
|
drawerLarge: "drawerLarge-TviQRx",
|
|
18
18
|
drawerScroll: "drawerScroll-oMah5X",
|
|
19
19
|
modal: "modal-bnEv25",
|
|
20
|
-
modalHead: "modalHead-LNaBLq"
|
|
20
|
+
modalHead: "modalHead-LNaBLq",
|
|
21
|
+
accountLink: "accountLink-jqPC1J"
|
|
21
22
|
};
|
|
22
23
|
export default container_module;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
:is(.section-R34Khp, .byline-admin-user-section) {
|
|
23
23
|
border: var(--border-width-thin) var(--border-style-solid) var(--gray-100);
|
|
24
24
|
background-color: var(--canvas-25);
|
|
25
|
-
border-radius:
|
|
25
|
+
border-radius: var(--border-radius-sm);
|
|
26
26
|
padding: 1rem;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -134,3 +134,7 @@
|
|
|
134
134
|
display: flex;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
:is(.accountLink-jqPC1J, .byline-admin-user-account-link) {
|
|
138
|
+
text-decoration: underline;
|
|
139
|
+
}
|
|
140
|
+
|
|
@@ -5,6 +5,7 @@ import { createAdminUser, setAdminUserPassword, setUserRoles, updateAdminUser }
|
|
|
5
5
|
import { adminSignIn } from "../server-fns/auth/index.js";
|
|
6
6
|
import { getCollectionDocumentVersion } from "../server-fns/collections/get.js";
|
|
7
7
|
import { setAdminLocaleFn } from "../server-fns/i18n/index.js";
|
|
8
|
+
import { passkeyAdminServices } from "./passkey-admin-services.js";
|
|
8
9
|
import { acceptSession, coordinateAuthAction, notifySessionAction } from "./session-coordination.js";
|
|
9
10
|
const byline_admin_services_getCollectionDocumentVersion = async (collection, documentId, versionId, locale)=>{
|
|
10
11
|
const result = await getCollectionDocumentVersion(collection, documentId, versionId, locale);
|
|
@@ -18,6 +19,7 @@ const bylineAdminServices = {
|
|
|
18
19
|
notifySessionAction();
|
|
19
20
|
return result;
|
|
20
21
|
},
|
|
22
|
+
passkeys: passkeyAdminServices,
|
|
21
23
|
updateAccount: updateAccount,
|
|
22
24
|
changeAccountPassword: changeAccountPassword,
|
|
23
25
|
setAdminLocale: setAdminLocaleFn,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Infonomic Company Limited
|
|
7
|
+
*/
|
|
8
|
+
import type { PasskeyAdminServices } from '@byline/admin/services';
|
|
9
|
+
export declare const passkeyAdminServices: PasskeyAdminServices;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getPasskeyCapability, passkeyEnrollment, passkeyEnrollmentOptions, passkeyList, passkeyManagementContext, passkeyPasswordProof, passkeyProof, passkeyProofOptions, passkeyRemove, passkeyRename, passkeySignIn, passkeySignInOptions } from "../server-fns/auth/passkeys.js";
|
|
2
|
+
import { acceptSession, coordinateAuthAction, flagSessionChanged, notifySessionAction, requireUnchanged, sessionChangedError, sessionSnapshot } from "./session-coordination.js";
|
|
3
|
+
const passkeyAdminServices = {
|
|
4
|
+
capability: ()=>getPasskeyCapability(),
|
|
5
|
+
captureLogin: (signIn = false)=>{
|
|
6
|
+
const snapshot = sessionSnapshot();
|
|
7
|
+
const assertCurrent = ()=>{
|
|
8
|
+
if (!signIn) return requireUnchanged(snapshot);
|
|
9
|
+
const current = sessionSnapshot();
|
|
10
|
+
if (current.epoch !== snapshot.epoch || current.sessionId !== snapshot.sessionId) throw sessionChangedError();
|
|
11
|
+
};
|
|
12
|
+
assertCurrent();
|
|
13
|
+
return {
|
|
14
|
+
expectedSessionId: snapshot.sessionId,
|
|
15
|
+
assertCurrent
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
managementContext: async (binding)=>{
|
|
19
|
+
binding.assertCurrent();
|
|
20
|
+
if (!binding.expectedSessionId) throw sessionChangedError();
|
|
21
|
+
const actor = await passkeyManagementContext({
|
|
22
|
+
data: {
|
|
23
|
+
expectedSessionId: binding.expectedSessionId
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
binding.assertCurrent();
|
|
27
|
+
return actor;
|
|
28
|
+
},
|
|
29
|
+
signInOptions: passkeySignInOptions,
|
|
30
|
+
signIn: (args, binding)=>coordinateAuthAction(async ()=>{
|
|
31
|
+
binding.assertCurrent();
|
|
32
|
+
const result = await passkeySignIn(args);
|
|
33
|
+
acceptSession(result.sessionId);
|
|
34
|
+
notifySessionAction();
|
|
35
|
+
return result;
|
|
36
|
+
}),
|
|
37
|
+
passwordProof: passkeyPasswordProof,
|
|
38
|
+
proofOptions: passkeyProofOptions,
|
|
39
|
+
proof: passkeyProof,
|
|
40
|
+
enrollmentOptions: passkeyEnrollmentOptions,
|
|
41
|
+
enrollment: passkeyEnrollment,
|
|
42
|
+
list: passkeyList,
|
|
43
|
+
rename: passkeyRename,
|
|
44
|
+
remove: async (args)=>{
|
|
45
|
+
const result = await passkeyRemove(args);
|
|
46
|
+
if (result.signedOut) {
|
|
47
|
+
flagSessionChanged();
|
|
48
|
+
notifySessionAction();
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export { passkeyAdminServices };
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
|
-
export declare const sessionChangedError: () => Error
|
|
8
|
+
export declare const sessionChangedError: () => Error & {
|
|
9
|
+
code: string;
|
|
10
|
+
};
|
|
9
11
|
export declare function expectedSession(): string | null;
|
|
10
12
|
export declare function sessionSnapshot(): {
|
|
11
13
|
sessionId: string | null;
|
|
@@ -4,7 +4,9 @@ let epoch = 0;
|
|
|
4
4
|
let changed = false;
|
|
5
5
|
let renewal;
|
|
6
6
|
const listeners = new Set();
|
|
7
|
-
const sessionChangedError = ()=>new Error('Session changed. Acknowledge the active account before continuing.')
|
|
7
|
+
const sessionChangedError = ()=>Object.assign(new Error('Session changed. Acknowledge the active account before continuing.'), {
|
|
8
|
+
code: 'ERR_SESSION_CHANGED'
|
|
9
|
+
});
|
|
8
10
|
function expectedSession() {
|
|
9
11
|
if ("u" < typeof window) return null;
|
|
10
12
|
if (!expected) expected = window.sessionStorage.getItem(storageKey);
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
|
-
/** The boundary owns the retry signal; handler errors cannot turn into retryable outcomes. */
|
|
9
8
|
export declare const adminSessionMiddleware: import("@tanstack/react-start").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, {
|
|
10
9
|
bylineExpectedSessionId: string | null;
|
|
11
10
|
}, undefined, undefined>;
|
|
11
|
+
export declare const adminSessionMutationMiddleware: import("@tanstack/react-start").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, {
|
|
12
|
+
bylineExpectedSessionId: string | null;
|
|
13
|
+
}, undefined, undefined>;
|