@icvdeveloper/common-module 2.4.0 → 2.4.1
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
|
@@ -4,6 +4,7 @@ import { storeToRefs } from "pinia";
|
|
|
4
4
|
import type { Conference } from "../../models/conference";
|
|
5
5
|
import { useLogin } from "../../composables/useLogin";
|
|
6
6
|
import { useTemplateConfigsStore } from "../../store";
|
|
7
|
+
import { usePortalStore } from "../../store";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
title?: string | null;
|
|
@@ -17,11 +18,23 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
17
18
|
|
|
18
19
|
const { title, conference } = toRefs<Props>(props);
|
|
19
20
|
|
|
21
|
+
const { data:portal } = storeToRefs(usePortalStore());
|
|
20
22
|
const { globalConfigValue } = storeToRefs(useTemplateConfigsStore());
|
|
21
23
|
|
|
24
|
+
// emits
|
|
25
|
+
const emit = defineEmits<{
|
|
26
|
+
(event: "showReset"): void;
|
|
27
|
+
|
|
28
|
+
}>();
|
|
29
|
+
|
|
22
30
|
// Methods
|
|
23
|
-
const { loginError, handleLogin, email, password, tooManySessions
|
|
31
|
+
const { loginError, handleLogin, email, password, tooManySessions } =
|
|
24
32
|
useLogin(conference);
|
|
33
|
+
|
|
34
|
+
const showReset = () => {
|
|
35
|
+
emit("showReset");
|
|
36
|
+
};
|
|
37
|
+
|
|
25
38
|
</script>
|
|
26
39
|
|
|
27
40
|
<template>
|
|
@@ -45,15 +58,15 @@ const { loginError, handleLogin, email, password, tooManySessions, showReset } =
|
|
|
45
58
|
Invalid email or password.
|
|
46
59
|
<br>
|
|
47
60
|
<a
|
|
48
|
-
v-if="
|
|
49
|
-
|
|
61
|
+
v-if="portal.is_virtual_template || globalConfigValue('secure_site_access_enabled', false)"
|
|
62
|
+
class="cursor-pointer"
|
|
63
|
+
@click="showReset"
|
|
50
64
|
>
|
|
51
65
|
Forgot Your Password?
|
|
52
66
|
</a>
|
|
53
67
|
<a
|
|
54
|
-
v-
|
|
55
|
-
|
|
56
|
-
@click="showReset"
|
|
68
|
+
v-else
|
|
69
|
+
href="/login/email"
|
|
57
70
|
>
|
|
58
71
|
Forgot Your Password?
|
|
59
72
|
</a>
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { ref, toRefs } from "vue";
|
|
3
3
|
import { useAuthStore } from "../../store/auth";
|
|
4
|
+
import type { TextInputClassObj } from "../../@types/components";
|
|
5
|
+
import { useClassBinding } from "../../composables/useClassBinding";
|
|
4
6
|
|
|
5
7
|
interface Props {
|
|
6
8
|
isCentered?: boolean;
|
|
9
|
+
classObject?: TextInputClassObj;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
const props = withDefaults(defineProps<Props>(), {
|
|
10
13
|
isCentered: false,
|
|
14
|
+
classObject: () => {
|
|
15
|
+
return {
|
|
16
|
+
classObject: ref<TextInputClassObj>({
|
|
17
|
+
container: "",
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
},
|
|
11
21
|
});
|
|
12
22
|
|
|
13
23
|
// data
|
|
14
24
|
const { isCentered } = toRefs(props);
|
|
25
|
+
const { classBinding } = useClassBinding();
|
|
26
|
+
|
|
15
27
|
const loading = ref<boolean>(false);
|
|
16
28
|
const email = ref<string>("");
|
|
17
29
|
const message = ref<null | string>(null);
|
|
@@ -25,11 +37,12 @@ const submitPasswordReset = () => {
|
|
|
25
37
|
errors.value = [];
|
|
26
38
|
passwordReset(email.value)
|
|
27
39
|
.then((response) => {
|
|
28
|
-
message.value = response.
|
|
40
|
+
message.value = response.message;
|
|
29
41
|
})
|
|
30
42
|
.catch((error) => {
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
console.log("error.response._data.errors", typeof(error.response?._data?.errors));
|
|
44
|
+
if (error.response.status === 401 && error.response?._data?.errors?.email) {
|
|
45
|
+
errors.value = error.response?._data?.errors?.email;
|
|
33
46
|
} else {
|
|
34
47
|
errors.value = ["Error requesting password reset."];
|
|
35
48
|
}
|
|
@@ -41,7 +54,10 @@ const submitPasswordReset = () => {
|
|
|
41
54
|
</script>
|
|
42
55
|
|
|
43
56
|
<template>
|
|
44
|
-
<div
|
|
57
|
+
<div
|
|
58
|
+
:class="isCentered ? 'w-full max-w-xs mx-auto text-center' : ''"
|
|
59
|
+
class="pt-8"
|
|
60
|
+
>
|
|
45
61
|
<div class="mb-4">
|
|
46
62
|
Enter your email address to reset your password.
|
|
47
63
|
</div>
|
|
@@ -62,6 +78,13 @@ const submitPasswordReset = () => {
|
|
|
62
78
|
v-model="email"
|
|
63
79
|
placeholder="Email"
|
|
64
80
|
type="email"
|
|
81
|
+
:class="
|
|
82
|
+
classBinding(
|
|
83
|
+
classObject,
|
|
84
|
+
'container',
|
|
85
|
+
'form-input contrast-border mb-2'
|
|
86
|
+
)
|
|
87
|
+
"
|
|
65
88
|
/>
|
|
66
89
|
<button
|
|
67
90
|
class="btn my-2"
|