@oniti/quasar-app-extension-vlank-auth 2.0.6 → 3.0.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/package.json
CHANGED
package/src/boot/index.js
CHANGED
|
@@ -221,17 +221,15 @@ export default boot(({ app, router, store }) => {
|
|
|
221
221
|
return new Promise((resolve, reject) => {
|
|
222
222
|
store.dispatch("auth/logout")
|
|
223
223
|
.then(() => {
|
|
224
|
-
let isPrivate =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return match.meta.requiresAuth;
|
|
228
|
-
});
|
|
229
|
-
}
|
|
224
|
+
let isPrivate = router.currentRoute._value.matched.some((match) => {
|
|
225
|
+
return match.meta.requiresAuth;
|
|
226
|
+
});
|
|
230
227
|
if (isPrivate) {
|
|
231
228
|
store.commit("auth/SET_WANTED_ROUTE", null);
|
|
232
229
|
router.push(helper.getLoginRoute());
|
|
233
230
|
}
|
|
234
231
|
store.commit("auth/SET_LOGOUT");
|
|
232
|
+
store.commit("auth/HAS_CHECK_AUTH");
|
|
235
233
|
resolve()
|
|
236
234
|
})
|
|
237
235
|
.catch(reject)
|
|
@@ -50,54 +50,49 @@
|
|
|
50
50
|
</q-card>
|
|
51
51
|
</div>
|
|
52
52
|
</template>
|
|
53
|
+
<script setup>
|
|
54
|
+
import { ref, onMounted, computed, watch, inject } from 'vue'
|
|
55
|
+
import { useStore } from 'vuex'
|
|
56
|
+
import { useQuasar } from 'quasar'
|
|
53
57
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const store = useStore()
|
|
59
|
+
const $q = useQuasar()
|
|
60
|
+
const $auth = inject('vlank-auth')
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
isPwd: true,
|
|
63
|
-
login: "",
|
|
64
|
-
password: "",
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
computed: {
|
|
68
|
-
...mapState({
|
|
69
|
-
has_check: (state) => state.auth.has_check,
|
|
70
|
-
}),
|
|
71
|
-
getUrlPasswordLost: function() {
|
|
72
|
-
return this.$q.config.onitiVlankAuth.defaultPasswordLostRoute
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
watch: {
|
|
76
|
-
has_check(newValue, oldValue) {
|
|
77
|
-
if (newValue) {
|
|
78
|
-
this.$q.loading.hide();
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
mounted() {
|
|
83
|
-
if (!this.$store.state.auth.has_check)
|
|
84
|
-
this.$q.loading.show({
|
|
85
|
-
delay: 0, // ms
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
methods: {
|
|
89
|
-
submitConnexion: function () {
|
|
90
|
-
this.$auth.login({
|
|
91
|
-
email: this.login,
|
|
92
|
-
password: this.password,
|
|
93
|
-
});
|
|
94
|
-
},
|
|
62
|
+
const isPwd = ref(true)
|
|
63
|
+
const login = ref("")
|
|
64
|
+
const password = ref("")
|
|
95
65
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
66
|
+
const has_check = computed(() => store.state.auth.has_check)
|
|
67
|
+
|
|
68
|
+
const getUrlPasswordLost = computed(() => {
|
|
69
|
+
return $q.config.onitiVlankAuth.defaultPasswordLostRoute
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const submitConnexion = function () {
|
|
73
|
+
$auth.login({
|
|
74
|
+
email: login.value,
|
|
75
|
+
password: password.value,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const getLogoImage = function () {
|
|
80
|
+
return require('vlank-auth-logo')
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
watch(has_check, (newValue, oldValue) => {
|
|
84
|
+
if(newValue) {
|
|
85
|
+
$q.loading.hide();
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
onMounted(() => {
|
|
90
|
+
if(!store.state.auth.has_check){
|
|
91
|
+
$q.loading.show({
|
|
92
|
+
delay: 0, // ms
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
})
|
|
101
96
|
</script>
|
|
102
97
|
|
|
103
98
|
<style lang="sass">
|
|
@@ -24,26 +24,25 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
|
-
<script>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
27
|
+
<script setup>
|
|
28
|
+
import { ref, inject } from 'vue'
|
|
29
|
+
import { useRouter } from 'vue-router'
|
|
30
|
+
|
|
31
|
+
const $auth = inject('vlank-auth')
|
|
32
|
+
const $router = useRouter()
|
|
33
|
+
|
|
34
|
+
const login = ref('')
|
|
35
|
+
|
|
36
|
+
const submitPasswordLost = function () {
|
|
37
|
+
$auth.passwordLost({
|
|
38
|
+
email: login.value
|
|
39
|
+
}).then(() => {
|
|
40
|
+
$router.push($auth.getLoginRoute())
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const getLogoImage = function () {
|
|
45
|
+
return require('vlank-auth-logo')
|
|
47
46
|
}
|
|
48
47
|
</script>
|
|
49
48
|
|
|
@@ -51,51 +51,54 @@
|
|
|
51
51
|
</div>
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
|
-
<script>
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
54
|
+
<script setup>
|
|
55
|
+
import { ref, computed, watch, inject } from 'vue'
|
|
56
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
57
|
+
import { useStore } from 'vuex'
|
|
58
|
+
import { useQuasar } from 'quasar'
|
|
59
|
+
|
|
60
|
+
const $route = useRoute()
|
|
61
|
+
const $router = useRouter()
|
|
62
|
+
const store = useStore()
|
|
63
|
+
const $q = useQuasar()
|
|
64
|
+
const $auth = inject('vlank-auth')
|
|
65
|
+
|
|
66
|
+
const isPwd = ref(true)
|
|
67
|
+
const token = ref($route.params.token)
|
|
68
|
+
const new_password = ref("")
|
|
69
|
+
const password_confirm = ref("")
|
|
70
|
+
|
|
71
|
+
const has_check = computed(() => {
|
|
72
|
+
return store.state.auth.has_check
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const submitPassword = function () {
|
|
76
|
+
$auth.resetPassword({
|
|
77
|
+
new_password: new_password.value,
|
|
78
|
+
password_confirm: password_confirm.value,
|
|
79
|
+
token: token.value
|
|
80
|
+
}).then(()=> {
|
|
81
|
+
$router.push($auth.getLoginRoute())
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const getLogoImage = function () {
|
|
86
|
+
return require('vlank-auth-logo')
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
watch(has_check, (newValue, oldValue) => {
|
|
90
|
+
if(newValue) {
|
|
91
|
+
$q.loading.hide();
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
if(!store.state.auth.has_check){
|
|
97
|
+
$q.loading.show({
|
|
98
|
+
delay: 0, // ms
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
})
|
|
99
102
|
</script>
|
|
100
103
|
|
|
101
104
|
<style lang="sass">
|