@icvdeveloper/common-module 1.1.4 → 1.1.6
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
package/dist/module.json
CHANGED
|
@@ -99,7 +99,7 @@ onMounted(() => {
|
|
|
99
99
|
</h1>
|
|
100
100
|
</div>
|
|
101
101
|
<div class="text-center">
|
|
102
|
-
<form @submit="submitLogin" action="javascript:void();">
|
|
102
|
+
<form @submit="submitLogin" action="javascript:void(0);">
|
|
103
103
|
<div class="ucc-form-field">
|
|
104
104
|
<div class="ucc-form-field-descr"></div>
|
|
105
105
|
<div class="ucc-input-wrapper required">
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { defineStore } from "pinia";
|
|
2
2
|
import { merge } from "lodash-es";
|
|
3
|
+
import { DateTime } from "luxon";
|
|
3
4
|
import { useApi } from "../composables/useApi.mjs";
|
|
4
5
|
import { useConferencesStore } from "./conferences.mjs";
|
|
5
6
|
export const useAuthStore = defineStore("auth", {
|
|
7
|
+
persist: {
|
|
8
|
+
afterRestore(context) {
|
|
9
|
+
if (context.store.$state.user) {
|
|
10
|
+
const user = context.store.$state.user;
|
|
11
|
+
const now = DateTime.now().setZone("utc");
|
|
12
|
+
const expiration = DateTime.fromFormat(
|
|
13
|
+
user.expires_at,
|
|
14
|
+
"yyyy-MM-dd HH:mm:ss",
|
|
15
|
+
{ zone: "utc" }
|
|
16
|
+
).minus({ hours: 2 });
|
|
17
|
+
if (now >= expiration) {
|
|
18
|
+
context.store.reset();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
6
23
|
state: () => ({
|
|
7
24
|
user: null
|
|
8
25
|
}),
|