@adminforth/open-signup 1.0.6 → 1.0.7
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
ADDED
package/custom/SignupPage.vue
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{{$t('Please check your email at')}} {{ sentToEmail }} {{$t('to confirm your email address.')}}
|
|
122
122
|
</div>
|
|
123
123
|
<p class="text-gray-500 dark:text-gray-400 font-sm text-right mt-3">
|
|
124
|
-
{{$t('
|
|
124
|
+
{{$t('Already have an account?')}} <Link :to="`/login${route.query.next ? `?next=${route.query.next}` : ''}`">{{ $t('login here') }}</Link>
|
|
125
125
|
</p>
|
|
126
126
|
</div>
|
|
127
127
|
</div>
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
<script setup lang="ts">
|
|
136
|
-
import { onMounted, ref, computed, Ref } from 'vue';
|
|
136
|
+
import { onMounted, ref, computed, Ref, onBeforeMount } from 'vue';
|
|
137
137
|
import { useCoreStore } from '@/stores/core';
|
|
138
138
|
import { useUserStore } from '@/stores/user';
|
|
139
139
|
import { callAdminForthApi, loadFile, applyRegexValidation } from '@/utils';
|
|
@@ -161,7 +161,6 @@ const sentToEmail: Ref<string> = ref('');
|
|
|
161
161
|
|
|
162
162
|
const requestEmailConfirmation = computed(() => route.meta.requestEmailConfirmation);
|
|
163
163
|
const verifyToken = computed(() => route.query.token);
|
|
164
|
-
const toLoginText = computed(() => verifyToken.value ? t('Go to login') : t('Back to login'));
|
|
165
164
|
const isPasswordNeeded = computed(() => !requestEmailConfirmation.value || (requestEmailConfirmation.value && verifyToken.value));
|
|
166
165
|
|
|
167
166
|
const user = useUserStore();
|
|
@@ -230,7 +229,36 @@ const passwordConstraints: Ref<{
|
|
|
230
229
|
validation: '',
|
|
231
230
|
});
|
|
232
231
|
|
|
232
|
+
// implement something similar to beforeEnter
|
|
233
|
+
// beforeEnter: async (to, from, next) => {
|
|
234
|
+
// if(localStorage.getItem('isAuthorized') === 'true') {
|
|
235
|
+
// // check if url has next=... and redirect to it
|
|
236
|
+
// console.log('to.query', to.query)
|
|
237
|
+
// if (to.query.next) {
|
|
238
|
+
// next(to.query.next.toString())
|
|
239
|
+
// } else {
|
|
240
|
+
// next({name: 'home'});
|
|
241
|
+
// }
|
|
242
|
+
// } else {
|
|
243
|
+
// next()
|
|
244
|
+
// }
|
|
245
|
+
// }
|
|
246
|
+
|
|
247
|
+
onBeforeMount(() => {
|
|
248
|
+
if (localStorage.getItem('isAuthorized') === 'true') {
|
|
249
|
+
// if route has next param, redirect
|
|
250
|
+
coreStore.fetchMenuAndResource();
|
|
251
|
+
if (route.query.next) {
|
|
252
|
+
router.push(route.query.next.toString());
|
|
253
|
+
} else {
|
|
254
|
+
router.push({ name: 'home' });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
|
|
233
259
|
onMounted(async () => {
|
|
260
|
+
|
|
261
|
+
|
|
234
262
|
await coreStore.getPublicConfig();
|
|
235
263
|
// getPasswordConstraints
|
|
236
264
|
passwordConstraints.value = await callAdminForthApi({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<p class="text-gray-500 dark:text-gray-400 font-sm text-left mt-3">
|
|
3
3
|
{{$t('Have no account?')}}
|
|
4
|
-
<Link to="
|
|
4
|
+
<Link :to="`/signup${route.query.next ? `?next=${route.query.next}` : ''}`">
|
|
5
5
|
{{$t('sign up now')}}
|
|
6
6
|
</Link>
|
|
7
7
|
</p>
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
11
|
import Link from '@/afcl/Link.vue';
|
|
12
|
+
import { useRoute } from 'vue-router';
|
|
13
|
+
|
|
14
|
+
const route = useRoute();
|
|
12
15
|
|
|
13
16
|
</script>
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{{$t('Please check your email at')}} {{ sentToEmail }} {{$t('to confirm your email address.')}}
|
|
122
122
|
</div>
|
|
123
123
|
<p class="text-gray-500 dark:text-gray-400 font-sm text-right mt-3">
|
|
124
|
-
{{$t('
|
|
124
|
+
{{$t('Already have an account?')}} <Link :to="`/login${route.query.next ? `?next=${route.query.next}` : ''}`">{{ $t('login here') }}</Link>
|
|
125
125
|
</p>
|
|
126
126
|
</div>
|
|
127
127
|
</div>
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
<script setup lang="ts">
|
|
136
|
-
import { onMounted, ref, computed, Ref } from 'vue';
|
|
136
|
+
import { onMounted, ref, computed, Ref, onBeforeMount } from 'vue';
|
|
137
137
|
import { useCoreStore } from '@/stores/core';
|
|
138
138
|
import { useUserStore } from '@/stores/user';
|
|
139
139
|
import { callAdminForthApi, loadFile, applyRegexValidation } from '@/utils';
|
|
@@ -161,7 +161,6 @@ const sentToEmail: Ref<string> = ref('');
|
|
|
161
161
|
|
|
162
162
|
const requestEmailConfirmation = computed(() => route.meta.requestEmailConfirmation);
|
|
163
163
|
const verifyToken = computed(() => route.query.token);
|
|
164
|
-
const toLoginText = computed(() => verifyToken.value ? t('Go to login') : t('Back to login'));
|
|
165
164
|
const isPasswordNeeded = computed(() => !requestEmailConfirmation.value || (requestEmailConfirmation.value && verifyToken.value));
|
|
166
165
|
|
|
167
166
|
const user = useUserStore();
|
|
@@ -230,7 +229,36 @@ const passwordConstraints: Ref<{
|
|
|
230
229
|
validation: '',
|
|
231
230
|
});
|
|
232
231
|
|
|
232
|
+
// implement something similar to beforeEnter
|
|
233
|
+
// beforeEnter: async (to, from, next) => {
|
|
234
|
+
// if(localStorage.getItem('isAuthorized') === 'true') {
|
|
235
|
+
// // check if url has next=... and redirect to it
|
|
236
|
+
// console.log('to.query', to.query)
|
|
237
|
+
// if (to.query.next) {
|
|
238
|
+
// next(to.query.next.toString())
|
|
239
|
+
// } else {
|
|
240
|
+
// next({name: 'home'});
|
|
241
|
+
// }
|
|
242
|
+
// } else {
|
|
243
|
+
// next()
|
|
244
|
+
// }
|
|
245
|
+
// }
|
|
246
|
+
|
|
247
|
+
onBeforeMount(() => {
|
|
248
|
+
if (localStorage.getItem('isAuthorized') === 'true') {
|
|
249
|
+
// if route has next param, redirect
|
|
250
|
+
coreStore.fetchMenuAndResource();
|
|
251
|
+
if (route.query.next) {
|
|
252
|
+
router.push(route.query.next.toString());
|
|
253
|
+
} else {
|
|
254
|
+
router.push({ name: 'home' });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
|
|
233
259
|
onMounted(async () => {
|
|
260
|
+
|
|
261
|
+
|
|
234
262
|
await coreStore.getPublicConfig();
|
|
235
263
|
// getPasswordConstraints
|
|
236
264
|
passwordConstraints.value = await callAdminForthApi({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<p class="text-gray-500 dark:text-gray-400 font-sm text-left mt-3">
|
|
3
3
|
{{$t('Have no account?')}}
|
|
4
|
-
<Link to="
|
|
4
|
+
<Link :to="`/signup${route.query.next ? `?next=${route.query.next}` : ''}`">
|
|
5
5
|
{{$t('sign up now')}}
|
|
6
6
|
</Link>
|
|
7
7
|
</p>
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
11
|
import Link from '@/afcl/Link.vue';
|
|
12
|
+
import { useRoute } from 'vue-router';
|
|
13
|
+
|
|
14
|
+
const route = useRoute();
|
|
12
15
|
|
|
13
16
|
</script>
|