@oniti/quasar-app-extension-vlank-auth 3.2.0 → 3.2.2

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/README.md CHANGED
@@ -46,7 +46,20 @@ chainWebpack(chain) {
46
46
  });
47
47
  }
48
48
  ```
49
-
49
+ ### Configuration Optional
50
+ ```javascript
51
+ framework:{
52
+ ...,
53
+ config:{
54
+ onitiVlankAuth: {
55
+ check_route_access_overide: (user, to) =>{
56
+ return false
57
+ }
58
+ },
59
+ ...
60
+ }
61
+ }
62
+ ```
50
63
  ### Usage
51
64
  Just add requieresAuth as meta on route to require an auth.
52
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oniti/quasar-app-extension-vlank-auth",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Authentification",
5
5
  "author": "François BOUYER <francois@oniti.fr>",
6
6
  "license": "MIT",
package/src/boot/index.js CHANGED
@@ -42,6 +42,7 @@ export default boot(({ app, router, store }) => {
42
42
  typeRightCheck = typeRightCheck ? typeRightCheck.meta.typeRightCheck : "all";
43
43
 
44
44
  const getter_right_check = typeRightCheck === "any" ? "auth/checkAny" : "auth/checkAll";
45
+ const check_route_access_overide = config.check_route_access_overide;
45
46
 
46
47
  let logoutOnUnsufisantRights = to.matched.find((r) =>
47
48
  r.meta.hasOwnProperty("logoutOnUnsufisantRights")
@@ -57,7 +58,7 @@ export default boot(({ app, router, store }) => {
57
58
  // eslint-disable-next-line
58
59
  if (store.getters["auth/isAuthenticated"]) {
59
60
  // Pas les droits nécéssaires
60
- if (!store.getters[getter_right_check](rights)) {
61
+ if ((check_route_access_overide && check_route_access_overide(store.getters['user'],to)) || (!check_route_access_overide &&!store.getters[getter_right_check](rights))) {
61
62
  if (logoutOnUnsufisantRights) {
62
63
  store.dispatch("auth/logout");
63
64
  next(helper.getLoginRoute());
@@ -10,10 +10,18 @@
10
10
  color="primary q-mb-md"
11
11
  label="Nouveau mot de passe"
12
12
  name="new_password"
13
+ :type="isNewPwd ? 'password' : 'text'"
13
14
  @enter-press="submitPassword"
14
15
  >
15
16
  <template v-slot:prepend>
16
- <q-icon name="mdi-email" />
17
+ <q-icon name="mdi-lock" />
18
+ </template>
19
+ <template v-slot:append>
20
+ <q-icon
21
+ :name="isNewPwd ? 'visibility_off' : 'visibility'"
22
+ class="cursor-pointer"
23
+ @click="isNewPwd = !isNewPwd"
24
+ />
17
25
  </template>
18
26
  </vlank-input>
19
27
  <vlank-input
@@ -24,10 +32,18 @@
24
32
  color="primary q-mb-md"
25
33
  label="Confirmation du mot de passe"
26
34
  name="password_confirm"
35
+ :type="isConfirmPwd ? 'password' : 'text'"
27
36
  @enter-press="submitPassword"
28
37
  >
29
38
  <template v-slot:prepend>
30
- <q-icon name="mdi-email" />
39
+ <q-icon name="mdi-check" />
40
+ </template>
41
+ <template v-slot:append>
42
+ <q-icon
43
+ :name="isConfirmPwd ? 'visibility_off' : 'visibility'"
44
+ class="cursor-pointer"
45
+ @click="isConfirmPwd = !isConfirmPwd"
46
+ />
31
47
  </template>
32
48
  </vlank-input>
33
49
  <q-btn
@@ -57,7 +73,8 @@ const store = useStore()
57
73
  const $q = useQuasar()
58
74
  const $auth = inject('vlank-auth')
59
75
 
60
- const isPwd = ref(true)
76
+ const isNewPwd = ref(true)
77
+ const isConfirmPwd = ref(true)
61
78
  const token = ref($route.params.token)
62
79
  const new_password = ref("")
63
80
  const password_confirm = ref("")