@jskit-ai/auth-web 0.2.12 → 0.2.13

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
@@ -6,6 +6,8 @@
6
6
  - Email confirmation on the sign-in page: "Confirm your email" has a field for the emailed link or its code, and in development, when the registration's answer carries the link, shows it with a button that confirms it. Opening the emailed link (`/auth/login?confirmation_token=...`) confirms it and takes the code out of the address. Confirming signs the person in and opens the requested page. A sign-in refused with `auth.login.emailUnconfirmed` opens "Confirm your email" instead of an error. New route `POST /api/register/confirm`, which writes the new session's cookies, limited by `config.auth.rateLimits.registerConfirm` (10 a minute); the register answer carries `confirmationUrl` when the provider gives it. New message keys: `jskit.auth.register.confirmed`, `jskit.auth.login.field.confirmationCode`, `jskit.auth.login.confirmEmail.confirm`, `.devLink`, `.useDevLink` and `jskit.auth.login.error.confirmRegistrationFailed`.
7
7
  - The auth routes' rate limits apply, per client address: `login`, `register`, `loginOtpRequest` and `loginOtpVerify` 10 a minute; `registerConfirmationResend` and `passwordForgot` 5; `oauthStart`, `oauthComplete`, `passwordRecovery` and `passwordReset` 20; `devLoginAs` 30. A refused request answers 429 with `kernel.http.rateLimited` and `Retry-After`, and the login page shows it.
8
8
  - `config.auth.rateLimits.<route>` changes a route's limit (`{ max, timeWindow }`, merged over the default) or removes it (`false`); an unknown route name or a malformed value stops startup. `AuthWebFeature` therefore requires `runtime.config`, which every installed runtime provides.
9
+ - The sign-in and sign-out screens use Material 3 colour roles and type: an elevated card on `surface-container` (the whole screen on phones), the selected sign-in mode on `secondary-container`, and the remembered-account and email-confirmation notes on `secondary-container`, without the tinted gradient and borders. The profile menu's button is Material 3's 40dp text button inside material-web's 48dp touch target instead of a fixed 48px height.
10
+ - Icons are Material Symbols `$aliases` (from `@jskit-ai/material-web`) instead of `@mdi/js` paths, and text uses Vuetify 4's Material 3 type classes (`text-body-large`, `text-title-medium`, ...) instead of Material 2 ones, which Vuetify 4 no longer styles. Upgrading: see the guide's [Move an app to the Material 3 defaults](https://mobily-enterprises.github.io/jskit-ai/guide/app-setup/material-3-migration).
9
11
 
10
12
  ## 0.2.0 - 2026-10-29
11
13
 
@@ -3,10 +3,11 @@ import { createPinia } from "pinia";
3
3
  import { createRouter, createWebHistory, RouterView } from "vue-router";
4
4
  import { QueryClient, VueQueryPlugin } from "@tanstack/vue-query";
5
5
  import "vuetify/styles";
6
+ import "@jskit-ai/material-web/client/material.css";
7
+ import { createMaterialVuetifyOptions } from "@jskit-ai/material-web/client";
6
8
  import { createVuetify } from "vuetify";
7
9
  import * as components from "vuetify/components";
8
10
  import * as directives from "vuetify/directives";
9
- import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
10
11
  import { SHELL_WEB_ERROR_RUNTIME_KEY } from "@jskit-ai/shell-web/client/error";
11
12
  import { SHELL_WEB_PLACEMENT_RUNTIME_KEY } from "@jskit-ai/shell-web/client/placement";
12
13
  import AuthProfileWidget from "../../src/client/views/AuthProfileWidget.vue";
@@ -82,7 +83,7 @@ app.provide(SHELL_WEB_ERROR_RUNTIME_KEY, errorRuntime);
82
83
  app.use(pinia);
83
84
  app.use(router);
84
85
  app.use(VueQueryPlugin, { queryClient: new QueryClient({ defaultOptions: { queries: { retry: false } } }) });
85
- app.use(createVuetify({ components, directives, icons: { defaultSet: "mdi", aliases, sets: { mdi } } }));
86
+ app.use(createVuetify({ components, directives, ...createMaterialVuetifyOptions() }));
86
87
  // The kernel hands an absent optional capability to a provider as null.
87
88
  const outputs = AuthWebClientProvider.setup({
88
89
  components: { register() {} },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-web",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -24,19 +24,16 @@
24
24
  "./test/playwright": "./src/test/playwright.js",
25
25
  "./locales/en.json": "./locales/en.json"
26
26
  },
27
- "dependencies": {
28
- "@mdi/js": "^7.4.47"
29
- },
30
27
  "peerDependencies": {
31
- "@jskit-ai/auth-core": "0.2.9",
32
- "@jskit-ai/http-runtime": "0.2.9",
33
- "@jskit-ai/kernel": "0.2.9",
34
- "@jskit-ai/shell-web": "0.2.10",
28
+ "@jskit-ai/auth-core": "0.2.10",
29
+ "@jskit-ai/http-runtime": "0.2.10",
30
+ "@jskit-ai/kernel": "0.2.10",
31
+ "@jskit-ai/shell-web": "0.2.11",
35
32
  "@tanstack/vue-query": "^5.90.5",
36
33
  "pinia": "^4.0.3",
37
34
  "vue": "^3.5.44",
38
35
  "vue-router": "^5.3.1",
39
- "vuetify": "^4.0.0"
36
+ "vuetify": "^4.3.0"
40
37
  },
41
38
  "description": "Auth web module: Fastify auth routes plus web login/sign-out scaffolds.",
42
39
  "jskit": {
@@ -306,5 +303,8 @@
306
303
  "singleton": true
307
304
  }
308
305
  }
306
+ },
307
+ "devDependencies": {
308
+ "@jskit-ai/material-web": "0.1.0"
309
309
  }
310
310
  }
@@ -1,4 +1,3 @@
1
- import { mdiGoogle } from "@mdi/js";
2
1
  import { authRegisterCommand } from "@jskit-ai/auth-core/shared/commands/authRegisterCommand";
3
2
  import { authRegisterConfirmationResendCommand } from "@jskit-ai/auth-core/shared/commands/authRegisterConfirmationResendCommand";
4
3
  import { authRegisterConfirmCommand } from "@jskit-ai/auth-core/shared/commands/authRegisterConfirmCommand";
@@ -483,7 +482,7 @@ export function useLoginViewActions({ state, validation, queryClient, errorRunti
483
482
 
484
483
  function oauthProviderIcon(provider) {
485
484
  if (String(provider?.id || "").toLowerCase() === "google") {
486
- return mdiGoogle;
485
+ return "$google";
487
486
  }
488
487
  return undefined;
489
488
  }
@@ -68,9 +68,9 @@ const placementContext = computed(() => {
68
68
  <v-btn v-bind="props" variant="text" class="auth-profile-widget__activator text-none pl-1 pr-2">
69
69
  <v-avatar size="32" color="primary" variant="tonal">
70
70
  <v-img v-if="avatarUrl" :src="avatarUrl" cover />
71
- <span v-else class="text-caption font-weight-medium">{{ initials }}</span>
71
+ <span v-else class="text-body-small font-weight-medium">{{ initials }}</span>
72
72
  </v-avatar>
73
- <span class="ml-2 d-none d-sm-inline text-body-2">{{ displayName }}</span>
73
+ <span class="ml-2 d-none d-sm-inline text-body-medium">{{ displayName }}</span>
74
74
  </v-btn>
75
75
  </template>
76
76
 
@@ -82,9 +82,3 @@ const placementContext = computed(() => {
82
82
  </v-list>
83
83
  </v-menu>
84
84
  </template>
85
-
86
- <style scoped>
87
- .auth-profile-widget__activator {
88
- min-height: 48px;
89
- }
90
- </style>
@@ -12,15 +12,14 @@
12
12
  <v-card
13
13
  class="auth-card"
14
14
  :class="{ 'auth-card--mobile': isMobileViewport }"
15
- :rounded="isMobileViewport ? false : 'lg'"
15
+ :rounded="isMobileViewport ? false : undefined"
16
16
  :elevation="isMobileViewport ? 0 : 1"
17
- :border="!isMobileViewport"
18
17
  >
19
18
  <v-card-text class="auth-content" :class="{ 'auth-content--mobile': isMobileViewport }">
20
19
  <div v-if="authTitle || authSubtitle" class="auth-header mb-5">
21
20
  <div>
22
- <h1 v-if="authTitle" class="auth-title">{{ authTitle }}</h1>
23
- <p v-if="authSubtitle" class="text-medium-emphasis mb-0">{{ authSubtitle }}</p>
21
+ <h1 v-if="authTitle" class="auth-title text-headline-medium">{{ authTitle }}</h1>
22
+ <p v-if="authSubtitle" class="on-surface-variant mb-0">{{ authSubtitle }}</p>
24
23
  </div>
25
24
  </div>
26
25
 
@@ -29,7 +28,7 @@
29
28
  data-testid="auth-mode-sign-in"
30
29
  class="text-none"
31
30
  :variant="isLogin ? 'flat' : 'text'"
32
- :color="isLogin ? 'primary' : undefined"
31
+ :color="isLogin ? 'secondary-container' : undefined"
33
32
  @click="switchMode('login')"
34
33
  >
35
34
  {{ t("jskit.auth.login.mode.signIn") }}
@@ -39,7 +38,7 @@
39
38
  data-testid="auth-mode-register"
40
39
  class="text-none"
41
40
  :variant="isRegister ? 'flat' : 'text'"
42
- :color="isRegister ? 'primary' : undefined"
41
+ :color="isRegister ? 'secondary-container' : undefined"
43
42
  @click="switchMode('register')"
44
43
  >
45
44
  {{ t("jskit.auth.login.mode.register") }}
@@ -49,14 +48,14 @@
49
48
  <v-form @submit.prevent="submitAuth" novalidate>
50
49
  <template v-if="isEmailConfirmationPending">
51
50
  <div class="email-confirmation-state mb-5">
52
- <p class="email-confirmation-message mb-0">
51
+ <p class="email-confirmation-message text-body-medium mb-0">
53
52
  {{ emailConfirmationMessage }}
54
53
  </p>
55
54
  </div>
56
55
 
57
56
  <div v-if="confirmationUrl" class="email-confirmation-dev-link mb-5" data-testid="auth-confirmation-dev-link">
58
- <p class="text-medium-emphasis mb-2">{{ t("jskit.auth.login.confirmEmail.devLink") }}</p>
59
- <p class="email-confirmation-url mb-3">{{ confirmationUrl }}</p>
57
+ <p class="text-body-medium on-surface-variant mb-2">{{ t("jskit.auth.login.confirmEmail.devLink") }}</p>
58
+ <p class="email-confirmation-url text-body-small mb-3">{{ confirmationUrl }}</p>
60
59
  <v-btn
61
60
  class="text-none"
62
61
  variant="flat"
@@ -119,10 +118,10 @@
119
118
  class="remembered-account d-flex align-center justify-space-between ga-3 mb-4"
120
119
  >
121
120
  <div class="remembered-copy flex-grow-1">
122
- <p class="remembered-title">
121
+ <p class="remembered-title text-title-small">
123
122
  {{ t("jskit.auth.login.rememberedAccount.welcomeBack", { name: rememberedAccountDisplayName }) }}
124
123
  </p>
125
- <p class="remembered-email">{{ rememberedAccountMaskedEmail }}</p>
124
+ <p class="remembered-email text-body-small">{{ rememberedAccountMaskedEmail }}</p>
126
125
  </div>
127
126
  <v-btn variant="text" color="secondary" class="text-none" @click="switchAccount">
128
127
  {{ rememberedAccountSwitchLabel }}
@@ -134,7 +133,7 @@
134
133
  class="first-account-setup mb-4"
135
134
  data-testid="auth-first-account-setup"
136
135
  >
137
- <p class="text-medium-emphasis mb-3">{{ t("jskit.auth.login.firstAccount.explain") }}</p>
136
+ <p class="text-body-medium mb-3">{{ t("jskit.auth.login.firstAccount.explain") }}</p>
138
137
  <v-text-field
139
138
  v-model="setupCode"
140
139
  :label="t('jskit.auth.login.field.setupCode')"
@@ -168,7 +167,7 @@
168
167
  density="comfortable"
169
168
  :autocomplete="isRegister ? 'new-password' : 'current-password'"
170
169
  :error-messages="passwordErrorMessages"
171
- :append-inner-icon="showPassword ? mdiEyeOff : mdiEye"
170
+ :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
172
171
  @click:append-inner="togglePasswordVisibility"
173
172
  @blur="passwordTouched = true"
174
173
  class="mb-3"
@@ -183,7 +182,7 @@
183
182
  density="comfortable"
184
183
  autocomplete="new-password"
185
184
  :error-messages="confirmPasswordErrorMessages"
186
- :append-inner-icon="showConfirmPassword ? mdiEyeOff : mdiEye"
185
+ :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
187
186
  @click:append-inner="toggleConfirmPasswordVisibility"
188
187
  @blur="confirmPasswordTouched = true"
189
188
  class="mb-3"
@@ -265,21 +264,21 @@
265
264
  </v-btn>
266
265
 
267
266
  <div v-if="isRegister" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
268
- <span class="text-medium-emphasis">{{ t("jskit.auth.login.hasAccount") }}</span>
267
+ <span class="on-surface-variant">{{ t("jskit.auth.login.hasAccount") }}</span>
269
268
  <v-btn variant="text" color="secondary" @click="switchMode('login')">
270
269
  {{ t("jskit.auth.login.backToSignIn") }}
271
270
  </v-btn>
272
271
  </div>
273
272
 
274
273
  <div v-else-if="isForgot" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
275
- <span class="text-medium-emphasis">{{ t("jskit.auth.login.rememberedPassword") }}</span>
274
+ <span class="on-surface-variant">{{ t("jskit.auth.login.rememberedPassword") }}</span>
276
275
  <v-btn variant="text" color="secondary" @click="switchMode('login')">
277
276
  {{ t("jskit.auth.login.backToSignIn") }}
278
277
  </v-btn>
279
278
  </div>
280
279
 
281
280
  <div v-else-if="isOtp" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
282
- <span class="text-medium-emphasis">{{ t("jskit.auth.login.otherMethod") }}</span>
281
+ <span class="on-surface-variant">{{ t("jskit.auth.login.otherMethod") }}</span>
283
282
  <v-btn variant="text" color="secondary" @click="switchMode('login')">
284
283
  {{ t("jskit.auth.login.backToSignIn") }}
285
284
  </v-btn>
@@ -293,7 +292,6 @@
293
292
  </template>
294
293
 
295
294
  <script setup>
296
- import { mdiEye, mdiEyeOff } from "@mdi/js";
297
295
  import { useDisplay } from "vuetify";
298
296
  import { useLoginView } from "../runtime/useLoginView.js";
299
297
  import { useJskitText } from "../i18n.js";
@@ -377,12 +375,11 @@ function toggleConfirmPasswordVisibility() {
377
375
  z-index: 1;
378
376
  overflow-y: auto;
379
377
  min-height: var(--auth-screen-height);
380
- background-color: rgb(var(--v-theme-background));
381
- background-image: radial-gradient(circle at 15% 12%, rgba(var(--v-theme-primary), 0.14), transparent 32%);
378
+ background-color: rgb(var(--v-theme-surface-container));
382
379
  }
383
380
 
384
381
  .login-screen--mobile {
385
- background-image: none;
382
+ background-color: rgb(var(--v-theme-surface));
386
383
  }
387
384
 
388
385
  .login-shell {
@@ -413,52 +410,45 @@ function toggleConfirmPasswordVisibility() {
413
410
 
414
411
  .auth-title {
415
412
  margin: 0 0 8px;
416
- font-size: clamp(28px, 3vw, 32px);
417
- line-height: 1.2;
418
413
  color: rgb(var(--v-theme-on-surface));
419
414
  }
420
415
 
421
416
  .mode-switch {
422
- border-radius: 12px;
423
- background-color: rgba(var(--v-theme-on-surface), 0.06);
417
+ border-radius: 9999px;
418
+ background-color: rgb(var(--v-theme-surface-container-highest));
424
419
  }
425
420
 
426
- .email-confirmation-state {
421
+ .email-confirmation-state,
422
+ .remembered-account {
427
423
  border-radius: 12px;
428
- border: 1px solid rgba(var(--v-theme-primary), 0.34);
429
- background: rgba(var(--v-theme-primary), 0.12);
430
- padding: 16px;
424
+ background: rgb(var(--v-theme-secondary-container));
425
+ color: rgb(var(--v-theme-on-secondary-container));
431
426
  }
432
427
 
433
- .email-confirmation-message {
434
- color: rgb(var(--v-theme-on-surface));
435
- line-height: 1.5;
428
+ .email-confirmation-state {
429
+ padding: 16px;
436
430
  }
437
431
 
438
432
  .first-account-setup {
439
433
  border-radius: 12px;
440
- border: 1px solid rgba(var(--v-theme-warning), 0.5);
441
- background: rgba(var(--v-theme-warning), 0.08);
434
+ background: rgb(var(--v-theme-warning-container));
435
+ color: rgb(var(--v-theme-on-warning-container));
442
436
  padding: 16px;
443
437
  }
444
438
 
445
439
  .email-confirmation-dev-link {
446
440
  border-radius: 12px;
447
- border: 1px dashed rgba(var(--v-theme-on-surface), 0.34);
441
+ background: rgb(var(--v-theme-surface-container-highest));
448
442
  padding: 16px;
449
443
  }
450
444
 
451
445
  .email-confirmation-url {
452
446
  font-family: monospace;
453
- font-size: 0.85rem;
454
447
  overflow-wrap: anywhere;
455
448
  }
456
449
 
457
450
  .remembered-account {
458
- border-radius: 12px;
459
- border: 1px solid rgba(var(--v-theme-primary), 0.34);
460
- background: rgba(var(--v-theme-primary), 0.12);
461
- padding: 12px 14px;
451
+ padding: 12px 16px;
462
452
  }
463
453
 
464
454
  .remembered-copy {
@@ -467,24 +457,13 @@ function toggleConfirmPasswordVisibility() {
467
457
 
468
458
  .remembered-title {
469
459
  margin: 0;
470
- font-size: 14px;
471
- font-weight: 600;
472
- color: rgb(var(--v-theme-on-surface));
473
460
  }
474
461
 
475
462
  .remembered-email {
476
463
  margin: 2px 0 0;
477
- font-size: 12px;
478
- color: rgba(var(--v-theme-on-surface), 0.72);
479
464
  }
480
465
 
481
466
  .oauth-provider-button {
482
467
  justify-content: center;
483
468
  }
484
-
485
- @media (max-width: 959px) {
486
- .auth-title {
487
- font-size: 26px;
488
- }
489
- }
490
469
  </style>
@@ -39,7 +39,7 @@
39
39
  variant="outlined"
40
40
  density="comfortable"
41
41
  autocomplete="new-password"
42
- :append-inner-icon="showPassword ? mdiEyeOff : mdiEye"
42
+ :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
43
43
  :error-messages="passwordError"
44
44
  class="mb-3"
45
45
  @click:append-inner="showPassword = !showPassword"
@@ -51,7 +51,7 @@
51
51
  variant="outlined"
52
52
  density="comfortable"
53
53
  autocomplete="new-password"
54
- :append-inner-icon="showConfirmPassword ? mdiEyeOff : mdiEye"
54
+ :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
55
55
  :error-messages="confirmPasswordError"
56
56
  class="mb-4"
57
57
  @click:append-inner="showConfirmPassword = !showConfirmPassword"
@@ -73,7 +73,6 @@
73
73
  </template>
74
74
 
75
75
  <script setup>
76
- import { mdiEye, mdiEyeOff } from "@mdi/js";
77
76
  import { useDisplay } from "vuetify";
78
77
  import { useDefaultResetPasswordView } from "../composables/useDefaultResetPasswordView.js";
79
78
  import { useJskitText } from "../i18n.js";
@@ -1,15 +1,15 @@
1
1
  <template>
2
2
  <v-main class="signout-main">
3
3
  <v-container class="fill-height d-flex align-center justify-center py-8">
4
- <v-card class="signout-card" rounded="lg" elevation="1" border>
4
+ <v-card class="signout-card">
5
5
  <v-card-text class="pa-7">
6
- <h1 class="text-h5 mb-3">{{ t("jskit.auth.signOut.title") }}</h1>
6
+ <h1 class="text-headline-small mb-3">{{ t("jskit.auth.signOut.title") }}</h1>
7
7
 
8
- <p v-if="status === 'pending'" class="text-medium-emphasis mb-4">
8
+ <p v-if="status === 'pending'" class="on-surface-variant mb-4">
9
9
  {{ t("jskit.auth.signOut.pending") }}
10
10
  </p>
11
11
 
12
- <p v-if="status === 'error'" class="text-body-1 text-medium-emphasis mb-4">
12
+ <p v-if="status === 'error'" class="text-body-large on-surface-variant mb-4">
13
13
  {{ errorMessage || t("jskit.auth.signOut.failedTryAgain") }}
14
14
  </p>
15
15
 
@@ -50,8 +50,7 @@ const { status, errorMessage, retrySignOut, goToLogin } = useDefaultSignOutView(
50
50
 
51
51
  <style scoped>
52
52
  .signout-main {
53
- background-color: rgb(var(--v-theme-background));
54
- background-image: radial-gradient(circle at 15% 12%, rgba(var(--v-theme-primary), 0.14), transparent 32%);
53
+ background-color: rgb(var(--v-theme-surface-container));
55
54
  }
56
55
 
57
56
  .signout-card {
@@ -70,12 +70,15 @@ test("auth-web client capability includes mobile callback completion", () => {
70
70
  assert.match(authClientSource, /completeOAuthCallbackFromUrl/);
71
71
  });
72
72
 
73
- test("auth profile activator preserves the generated tap-target contract", () => {
73
+ test("auth profile activator keeps Material 3's 48dp touch target without a fixed height", () => {
74
74
  const widgetPath = fileURLToPath(new URL("../src/client/views/AuthProfileWidget.vue", import.meta.url));
75
75
  const widgetSource = readFileSync(widgetPath, "utf8");
76
76
 
77
77
  assert.match(widgetSource, /class="auth-profile-widget__activator text-none pl-1 pr-2"/);
78
- assert.match(widgetSource, /\.auth-profile-widget__activator\s*\{[\s\S]*min-height:\s*48px;/);
78
+ // material-web gives every default-size button a 48dp touch target around its 40dp body; a fixed height would
79
+ // make the button itself taller than Material 3 draws it.
80
+ assert.doesNotMatch(widgetSource, /min-height/u);
81
+ assert.doesNotMatch(widgetSource, /<v-btn[^>]*auth-profile-widget__activator[^>]*\ssize=/u);
79
82
  });
80
83
 
81
84
  test("default login view owns the viewport and becomes a full-screen mobile screen", () => {
@@ -90,7 +93,8 @@ test("default login view owns the viewport and becomes a full-screen mobile scre
90
93
  assert.match(viewSource, /auth-card--mobile/);
91
94
  assert.match(viewSource, /auth-content--mobile/);
92
95
  assert.match(viewSource, /:elevation="isMobileViewport \? 0 : 1"/);
93
- assert.match(viewSource, /:border="!isMobileViewport"/);
96
+ // An elevated Material 3 card on wide windows, the whole screen on phones; never an outlined one.
97
+ assert.doesNotMatch(viewSource, /:border=|\sborder(?=[\s>])/);
94
98
  assert.match(viewSource, /\.login-screen\s*\{[\s\S]*position:\s*fixed;/);
95
99
  // The full-viewport screen starts below shell banners shown on this bar-less surface.
96
100
  assert.match(viewSource, /\.login-screen\s*\{[\s\S]*inset:\s*var\(--shell-error-banners-inline-height, 0px\) 0 0;/);