@live-change/user-frontend 0.9.39 → 0.9.41

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.
@@ -78,6 +78,7 @@
78
78
  import Portal from 'primevue/portal';
79
79
  import BaseInput from '@primevue/core/baseinput';
80
80
  import PasswordStyle from 'primevue/password/style';
81
+ import { useId } from 'vue';
81
82
 
82
83
  export default {
83
84
  name: 'Password',
@@ -224,6 +225,12 @@
224
225
  inject: {
225
226
  $pcFluid: { default: null }
226
227
  },
228
+ setup() {
229
+ const uid = useId()
230
+ return {
231
+ uid
232
+ }
233
+ },
227
234
  data() {
228
235
  return {
229
236
  overlayVisible: false,
@@ -453,7 +460,7 @@
453
460
  return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
454
461
  },
455
462
  overlayUniqueId() {
456
- return this.$id + '_overlay';
463
+ return this.uid + '_overlay';
457
464
  }
458
465
  },
459
466
  watch: {
@@ -60,8 +60,9 @@ import { client as useClient } from '@live-change/vue3-ssr'
60
60
 
61
61
  export function installUserRedirects(router, app, config) {
62
62
  const client = useClient(app._context)
63
- if(typeof window === 'undefined') return
64
- router.beforeEach(async (to, from) => {
63
+ router.afterEach(async (to, from) => {
64
+ console.log("AFTER EACH", to, from)
65
+ if(typeof window === 'undefined') return
65
66
  if(to?.matched.find(m => m?.meta.signedIn)) {
66
67
  if(!client.value.user) {
67
68
  console.log("REDIRECT TO LOGIN BECAUSE PAGE REQUIRES LOGIN!")
@@ -72,15 +73,12 @@ export function installUserRedirects(router, app, config) {
72
73
  query: to.query,
73
74
  hash: to.hash
74
75
  })
76
+ setTimeout(() => {
77
+ router.push({ name: 'user:signInEmail' })
78
+ }, 50)
75
79
  return { name: 'user:signInEmail' }
76
80
  }
77
81
  }
78
- if(to?.matched.find(m => m?.meta.signedOut)) {
79
- if(client.value.user) {
80
- console.log("REDIRECT TO USER INDEX BECAUSE PAGE REQUIRES LOGOUT!")
81
- return { name: 'user:settings' }
82
- }
83
- }
84
82
  if(to && to.name === 'user:signInEmail' && from?.matched.find(m => m?.meta.saveForSignIn)) {
85
83
  console.log("SAVE FOR LOGIN", from)
86
84
  localStorage.redirectAfterSignIn = JSON.stringify({
@@ -91,6 +89,14 @@ export function installUserRedirects(router, app, config) {
91
89
  })
92
90
  }
93
91
  })
92
+ router.beforeEach(async (to, from) => {
93
+ if(to?.matched.find(m => m?.meta.signedOut)) {
94
+ if(client.value.user) {
95
+ console.log("REDIRECT TO USER INDEX BECAUSE PAGE REQUIRES LOGOUT!")
96
+ return { name: 'user:settings' }
97
+ }
98
+ }
99
+ })
94
100
  }
95
101
 
96
102
  export function createRouter(app, config) {
@@ -1,7 +1,11 @@
1
1
  <template>
2
- <div class="flex relative lg:static bg-surface-50 dark:bg-surface-950" style="height: calc(100vh - 88px)">
3
- <div id="settings-menu" class="bg-surface-0 hidden flex-shrink-0 absolute left-0 h-full
4
- top-0 z-1 border-r-1 border-r-surface-300 dark:border-r-surface-750 select-none md:static md:block" style="width:280px">
2
+ <div class="flex relative lg:static bg-surface-50 dark:bg-surface-950"
3
+ style="height: calc(100vh - 88px)">
4
+ <div id="settings-menu"
5
+ class="bg-surface-0 dark:bg-surface-950 flex-shrink-0 absolute left-0 h-full
6
+ top-0 z-1 border-r-1 border-r-surface-300 dark:border-r-surface-700 select-none
7
+ hidden md:static md:block"
8
+ style="width:280px">
5
9
  <SettingsMenu />
6
10
  </div>
7
11
 
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <li class="block">
3
3
  <router-link :to="{ name }"
4
- :class="route.name == name ? 'text-blue-500' : 'text-700'"
4
+ :class="route.name == name ? 'text-primary-500 dark:text-primary-300' : 'text-surface-700 dark:text-surface-300'"
5
5
  v-ripple
6
- class="flex align-items-center cursor-pointer p-3 hover:surface-100
7
- border-round transition-colors transition-duration-150 p-ripple no-underline">
6
+ class="flex align-items-center cursor-pointer p-3
7
+ hover:bg-surface-100 dark:hover:bg-surface-800
8
+ rounded-border transition-colors transition-duration-150 p-ripple no-underline">
8
9
  <i class="pi mr-2" :class="'pi-'+icon"></i>
9
10
  <span class="font-medium">{{ label }}</span>
10
11
  </router-link>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.9.39",
3
+ "version": "0.9.41",
4
4
  "scripts": {
5
5
  "memDev": "node --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
@@ -22,29 +22,29 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/cli": "^0.9.39",
26
- "@live-change/dao": "^0.9.39",
27
- "@live-change/dao-vue3": "^0.9.39",
28
- "@live-change/dao-websocket": "^0.9.39",
29
- "@live-change/email-service": "^0.9.39",
30
- "@live-change/framework": "^0.9.39",
31
- "@live-change/identicon-service": "^0.9.39",
32
- "@live-change/image-frontend": "^0.9.39",
33
- "@live-change/message-authentication-service": "^0.9.39",
34
- "@live-change/notification-service": "^0.9.39",
35
- "@live-change/password-authentication-service": "^0.9.39",
36
- "@live-change/pattern": "^0.9.39",
37
- "@live-change/secret-code-service": "^0.9.39",
38
- "@live-change/secret-link-service": "^0.9.39",
39
- "@live-change/security-frontend": "^0.9.39",
40
- "@live-change/security-service": "^0.9.39",
41
- "@live-change/session-service": "^0.9.39",
42
- "@live-change/timer-service": "^0.9.39",
43
- "@live-change/upload-service": "^0.9.39",
44
- "@live-change/user-identification-service": "^0.9.39",
45
- "@live-change/user-service": "^0.9.39",
46
- "@live-change/vue3-components": "^0.9.39",
47
- "@live-change/vue3-ssr": "^0.9.39",
25
+ "@live-change/cli": "^0.9.41",
26
+ "@live-change/dao": "^0.9.41",
27
+ "@live-change/dao-vue3": "^0.9.41",
28
+ "@live-change/dao-websocket": "^0.9.41",
29
+ "@live-change/email-service": "^0.9.41",
30
+ "@live-change/framework": "^0.9.41",
31
+ "@live-change/identicon-service": "^0.9.41",
32
+ "@live-change/image-frontend": "^0.9.41",
33
+ "@live-change/message-authentication-service": "^0.9.41",
34
+ "@live-change/notification-service": "^0.9.41",
35
+ "@live-change/password-authentication-service": "^0.9.41",
36
+ "@live-change/pattern": "^0.9.41",
37
+ "@live-change/secret-code-service": "^0.9.41",
38
+ "@live-change/secret-link-service": "^0.9.41",
39
+ "@live-change/security-frontend": "^0.9.41",
40
+ "@live-change/security-service": "^0.9.41",
41
+ "@live-change/session-service": "^0.9.41",
42
+ "@live-change/timer-service": "^0.9.41",
43
+ "@live-change/upload-service": "^0.9.41",
44
+ "@live-change/user-identification-service": "^0.9.41",
45
+ "@live-change/user-service": "^0.9.41",
46
+ "@live-change/vue3-components": "^0.9.41",
47
+ "@live-change/vue3-ssr": "^0.9.41",
48
48
  "@vueuse/core": "^12.3.0",
49
49
  "codeceptjs-assert": "^0.0.5",
50
50
  "codeceptjs-video-helper": "0.1.3",
@@ -65,7 +65,7 @@
65
65
  "wtfnode": "^0.9.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@live-change/codeceptjs-helper": "^0.9.39",
68
+ "@live-change/codeceptjs-helper": "^0.9.41",
69
69
  "codeceptjs": "^3.6.10",
70
70
  "generate-password": "1.7.1",
71
71
  "playwright": "1.49.1",
@@ -76,5 +76,5 @@
76
76
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
77
77
  "license": "BSD-3-Clause",
78
78
  "description": "",
79
- "gitHead": "f4452af484b26bb40e252cdcf4492706cd453c4d"
79
+ "gitHead": "88ccfef9ea84e2de85935f771d2b03dabfa8d845"
80
80
  }