@jskit-ai/auth-web 0.2.23 → 0.2.24
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
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- The sign-in screen's action rows wrap: on a phone, "Confirm your email"'s three actions (go to the main screen, resend the confirmation email, back to sign in) reflow onto a second line inside the card, as Material 3 reflows actions that do not fit, where the row clipped its last button at 390px. The reset and one-time-code rows and the forgot-password links wrap the same way, keeping their 12px gap.
|
|
5
6
|
- The sign-in, registration and reset-password fields have no margin under them, since each keeps its supporting-text line (`@jskit-ai/material-web` no longer sets `hideDetails: "auto"`): an email or password error shown on blur appears in place instead of pushing the form down.
|
|
6
7
|
- `loginRequestAsExistingUser(request, options)` (new, `@jskit-ai/auth-web/test/playwright`) signs a Playwright APIRequestContext in, as `loginAsExistingUser()` signs a page's context in: a browser test `signIn` module uses it to sign each worker in once.
|
|
7
8
|
- `loginAsExistingUser(page, { email | userId, secret })` from `@jskit-ai/auth-web/test/playwright` signs in on the test's own server: with no `baseURL`, its requests go to the page context's `baseURL`, so each Playwright worker signs in on its own server (`browserTestConfig()`), instead of `PLAYWRIGHT_BASE_URL` or `127.0.0.1:${PLAYWRIGHT_PORT || 4173}`, which sent every worker's sign-in to the first worker's server. The dev-auth secret still goes only to a local server: the one a given `baseURL` names, or the one that answered the session request; a managed `PLAYWRIGHT_BASE_URL` is still refused before any request.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/auth-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"./locales/en.json": "./locales/en.json"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@jskit-ai/auth-core": "0.2.
|
|
29
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
30
|
-
"@jskit-ai/kernel": "0.2.
|
|
31
|
-
"@jskit-ai/shell-web": "0.2.
|
|
28
|
+
"@jskit-ai/auth-core": "0.2.18",
|
|
29
|
+
"@jskit-ai/http-runtime": "0.2.18",
|
|
30
|
+
"@jskit-ai/kernel": "0.2.18",
|
|
31
|
+
"@jskit-ai/shell-web": "0.2.22",
|
|
32
32
|
"@tanstack/vue-query": "^5.90.5",
|
|
33
33
|
"pinia": "^4.0.3",
|
|
34
34
|
"vue": "^3.5.44",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
</v-btn>
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
<div class="switch-row d-flex align-center justify-space-between ga-3">
|
|
140
|
+
<div class="switch-row d-flex flex-wrap align-center justify-space-between ga-3">
|
|
141
141
|
<v-btn class="text-none" variant="tonal" color="primary" @click="goToMainScreen">
|
|
142
142
|
{{ t("jskit.auth.login.confirmEmail.goToMainScreen") }}
|
|
143
143
|
</v-btn>
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
@blur="otpCodeTouched = true"
|
|
242
242
|
/>
|
|
243
243
|
|
|
244
|
-
<div v-if="isLogin && (canRequestPasswordRecovery || canUseOtp)" class="aux-links d-flex justify-end mb-4">
|
|
244
|
+
<div v-if="isLogin && (canRequestPasswordRecovery || canUseOtp)" class="aux-links d-flex flex-wrap justify-end mb-4">
|
|
245
245
|
<v-btn
|
|
246
246
|
v-if="canRequestPasswordRecovery"
|
|
247
247
|
variant="text"
|
|
@@ -304,14 +304,14 @@
|
|
|
304
304
|
{{ submitLabel }}
|
|
305
305
|
</v-btn>
|
|
306
306
|
|
|
307
|
-
<div v-if="isForgot" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
|
|
307
|
+
<div v-if="isForgot" class="switch-row mt-4 d-flex flex-wrap align-center justify-space-between ga-3">
|
|
308
308
|
<span class="on-surface-variant">{{ t("jskit.auth.login.rememberedPassword") }}</span>
|
|
309
309
|
<v-btn variant="text" color="secondary" @click="switchMode('login')">
|
|
310
310
|
{{ t("jskit.auth.login.backToSignIn") }}
|
|
311
311
|
</v-btn>
|
|
312
312
|
</div>
|
|
313
313
|
|
|
314
|
-
<div v-else-if="isOtp" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
|
|
314
|
+
<div v-else-if="isOtp" class="switch-row mt-4 d-flex flex-wrap align-center justify-space-between ga-3">
|
|
315
315
|
<span class="on-surface-variant">{{ t("jskit.auth.login.otherMethod") }}</span>
|
|
316
316
|
<v-btn variant="text" color="secondary" @click="switchMode('login')">
|
|
317
317
|
{{ t("jskit.auth.login.backToSignIn") }}
|
|
@@ -125,6 +125,18 @@ test("default login view avoids decorative login chrome", () => {
|
|
|
125
125
|
assert.doesNotMatch(constantsSource, /\[LOGIN_MODE\]:\s*"Sign in to continue\.?"/);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
test("default login view's action rows wrap, so a phone shows every action instead of clipping the last", () => {
|
|
129
|
+
const viewSource = readFileSync(fileURLToPath(new URL("../src/client/views/DefaultLoginView.vue", import.meta.url)), "utf8");
|
|
130
|
+
const rows = [...viewSource.matchAll(/class="((?:switch-row|aux-links)\b[^"]*)"/gu)].map(([, classes]) => classes);
|
|
131
|
+
|
|
132
|
+
assert.equal(rows.filter((classes) => classes.startsWith("switch-row")).length, 3);
|
|
133
|
+
for (const classes of rows.filter((entry) => entry.startsWith("switch-row"))) {
|
|
134
|
+
assert.match(classes, /\bflex-wrap\b/u, classes);
|
|
135
|
+
assert.match(classes, /\bga-3\b/u, classes);
|
|
136
|
+
}
|
|
137
|
+
assert.match(rows.find((classes) => classes.startsWith("aux-links")), /\bflex-wrap\b/u);
|
|
138
|
+
});
|
|
139
|
+
|
|
128
140
|
test("default login view gates password login controls by provider capabilities", () => {
|
|
129
141
|
const viewPath = fileURLToPath(new URL("../src/client/views/DefaultLoginView.vue", import.meta.url));
|
|
130
142
|
const validationPath = fileURLToPath(new URL("../src/client/composables/loginView/useLoginViewValidation.js", import.meta.url));
|
|
@@ -283,6 +283,37 @@ test("register waits for email confirmation, and the other modes reach their req
|
|
|
283
283
|
await finish(api);
|
|
284
284
|
});
|
|
285
285
|
|
|
286
|
+
// Material 3 reflows actions that do not fit: on a phone, Confirm your email's three actions wrap inside the card.
|
|
287
|
+
test("on a phone, Confirm your email's three actions wrap inside the card, none clipped", options, async () => {
|
|
288
|
+
const api = await openApp({
|
|
289
|
+
viewport: { width: 390, height: 844 },
|
|
290
|
+
routes: { "POST /api/register": { json: { requiresEmailConfirmation: true, username: "Ada" } } }
|
|
291
|
+
});
|
|
292
|
+
const { page } = api;
|
|
293
|
+
await page.goto("/auth/login?returnTo=/home&mode=register");
|
|
294
|
+
await page.getByLabel("Email").fill("ada@example.com");
|
|
295
|
+
await page.getByLabel("Password", { exact: true }).fill("Correct-horse-1");
|
|
296
|
+
await page.getByLabel("Confirm password", { exact: true }).fill("Correct-horse-1");
|
|
297
|
+
await page.getByTestId("auth-submit").click();
|
|
298
|
+
await expect(page.getByText("Confirm your email")).toBeVisible();
|
|
299
|
+
const layout = await page.locator(".switch-row").evaluate((element) => ({
|
|
300
|
+
row: element.getBoundingClientRect().toJSON(),
|
|
301
|
+
overflows: element.scrollWidth > element.clientWidth,
|
|
302
|
+
buttons: [...element.querySelectorAll(".v-btn")].map((button) => ({
|
|
303
|
+
text: button.textContent.trim(),
|
|
304
|
+
...button.getBoundingClientRect().toJSON()
|
|
305
|
+
}))
|
|
306
|
+
}));
|
|
307
|
+
assert.deepEqual(layout.buttons.map(({ text }) => text), ["Go to main screen", "Resend confirmation email", "Back to sign in"]);
|
|
308
|
+
assert.equal(layout.overflows, false, "the row does not overflow");
|
|
309
|
+
for (const button of layout.buttons) {
|
|
310
|
+
assert.ok(button.left >= layout.row.left - 0.5 && button.right <= layout.row.right + 0.5, `${button.text} lies inside the row`);
|
|
311
|
+
assert.ok(button.right <= 390, `${button.text} lies inside the screen`);
|
|
312
|
+
}
|
|
313
|
+
assert.ok(new Set(layout.buttons.map(({ top }) => Math.round(top))).size > 1, "the actions wrap onto more than one line");
|
|
314
|
+
await finish(api);
|
|
315
|
+
});
|
|
316
|
+
|
|
286
317
|
test("email confirmation takes the registration's password: the development link, a pasted link after an unconfirmed sign-in, and the emailed link", options, async () => {
|
|
287
318
|
const session = {
|
|
288
319
|
...SIGNED_OUT,
|