@oniti/quasar-app-extension-vlank-auth 3.1.2 → 3.2.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/README.md CHANGED
@@ -35,6 +35,10 @@ chainWebpack(chain) {
35
35
  __dirname,
36
36
  "src/assets/logo-app.png"
37
37
  ),
38
+ "vlank-auth-logo-text": path.resolve(
39
+ __dirname,
40
+ "src/assets/logo-app-text.png"
41
+ ),
38
42
  "vlank-auth-layout": path.resolve(
39
43
  __dirname,
40
44
  "src/layouts/EmptyLayout.vue"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oniti/quasar-app-extension-vlank-auth",
3
- "version": "3.1.2",
3
+ "version": "3.2.1",
4
4
  "description": "Authentification",
5
5
  "author": "François BOUYER <francois@oniti.fr>",
6
6
  "license": "MIT",
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <div class="absolute-center container">
3
- <q-card class="fit column q-pa-lg">
3
+ <q-card class="fit column q-pa-lg login-form-container">
4
4
  <q-img alt="" class="logo q-mb-md" :src="getLogoImage()" />
5
5
  <vlank-input
6
6
  v-model="login"
7
- class="q-ml-md q-mr-md login"
7
+ outlined
8
+ rounded
9
+ class="login"
8
10
  color="primary q-mb-md"
9
11
  label="Adresse mail"
10
12
  name="login"
@@ -16,8 +18,10 @@
16
18
  </vlank-input>
17
19
  <vlank-input
18
20
  v-model="password"
21
+ outlined
22
+ rounded
19
23
  :type="isPwd ? 'password' : 'text'"
20
- class="q-ml-md q-mr-md login"
24
+ class="login"
21
25
  label="Mot de passe"
22
26
  name="password"
23
27
  @enter-press="submitConnexion"
@@ -34,9 +38,10 @@
34
38
  </template>
35
39
  </vlank-input>
36
40
  <q-btn
37
- class="q-ma-md float-right"
41
+ class="q-ma-md float-right connexion-btn"
38
42
  color="accent"
39
- label="Valider"
43
+ label="Connexion"
44
+ rounded
40
45
  unelevated
41
46
  @click="submitConnexion"
42
47
  />
@@ -47,16 +52,22 @@
47
52
  :href="getUrlPasswordLost"
48
53
  label="Mot de passe oublié ?"
49
54
  />
55
+ <div class="text-logo">
56
+ <a href="https://www.oniti.fr/"><img alt="Oniti.fr" :src="getLogoBottomImage()" /></a>
57
+ </div>
50
58
  </q-card>
51
59
  </div>
52
60
  </template>
61
+
53
62
  <script setup>
54
63
  import { ref, onMounted, computed, watch, inject } from 'vue'
55
64
  import { useStore } from 'vuex'
56
65
  import { useQuasar } from 'quasar'
66
+ import { useRouter } from 'vue-router'
57
67
 
58
68
  const store = useStore()
59
69
  const $q = useQuasar()
70
+ const $router = useRouter()
60
71
  const $auth = inject('vlank-auth')
61
72
 
62
73
  const isPwd = ref(true)
@@ -69,6 +80,7 @@ const getUrlPasswordLost = computed(() => {
69
80
  return $q.config.onitiVlankAuth.defaultPasswordLostRoute
70
81
  })
71
82
 
83
+
72
84
  const submitConnexion = function () {
73
85
  $auth.login({
74
86
  email: login.value,
@@ -80,6 +92,12 @@ const getLogoImage = function () {
80
92
  return require('vlank-auth-logo')
81
93
  }
82
94
 
95
+
96
+ const getLogoBottomImage = function () {
97
+ return require('vlank-auth-logo-text')
98
+ }
99
+
100
+
83
101
  watch(has_check, (newValue, oldValue) => {
84
102
  if(newValue) {
85
103
  $q.loading.hide();
@@ -95,17 +113,38 @@ onMounted(() => {
95
113
  })
96
114
  </script>
97
115
 
98
- <style lang="sass">
99
- .container
100
- .q-card
101
- .logo
102
- width: 9vw
103
- margin-left: auto
104
- margin-right: auto
105
-
106
- @media(max-width: 768px)
107
- .container
108
- left: 0
109
- width: 100%
110
- transform: translate(0, -50%)
116
+ <style lang="scss" scoped>
117
+
118
+ .login-form-container {
119
+ border-radius: 40px;
120
+ min-width: 415px;
121
+ }
122
+
123
+ .connexion-btn {
124
+ padding: 15px
125
+ }
126
+
127
+ .logo {
128
+ width: 140px;
129
+ top: -120px;
130
+ }
131
+
132
+ .container {
133
+ .q-card {
134
+ .logo {
135
+ width: 12rem;
136
+ margin-left: auto;
137
+ margin-right: auto;
138
+ margin-bottom: -90px;
139
+ }
140
+ }
141
+ }
142
+
143
+ @media(max-width: 768px) {
144
+ .container {
145
+ left: 0;
146
+ width: 100%;
147
+ transform: translate(0, -50%);
148
+ }
149
+ }
111
150
  </style>
@@ -1,25 +1,40 @@
1
1
  <template>
2
2
  <div class="absolute-center container">
3
- <q-card class="fit column q-pa-lg">
4
- <img alt="" class="logo q-mb-md" :src="getLogoImage()"/>
5
- <p class="password-lost-title">Entrez votre email pour réinitialiser votre mot de passe</p>
6
- <vlank-input v-model="login" class="q-ml-md q-mr-md login" color="primary q-mb-md" label="Adresse mail"
7
- name="login" @enter-press="submitPasswordLost">
3
+ <q-card class="fit column q-pa-lg login-form-container">
4
+ <q-img alt="" class="logo q-mb-md" :src="getLogoImage()" />
5
+ <p>Un lien vous sera envoyé par email pour réinitialiser votre mot de passe</p>
6
+ <vlank-input
7
+ v-model="login"
8
+ outlined
9
+ rounded
10
+ class="login"
11
+ color="primary q-mb-md"
12
+ label="Adresse mail"
13
+ name="login"
14
+ @enter-press="submitPasswordLost"
15
+ >
8
16
  <template v-slot:prepend>
9
- <q-icon name="mdi-account"/>
17
+ <q-icon name="mdi-email" />
10
18
  </template>
11
19
  </vlank-input>
12
- <template v-slot:prepend>
13
- <q-icon name="mdi-lock"/>
14
- </template>
15
- <template v-slot:append>
16
- <q-icon
17
- :name="isPwd ? 'mdi-eye-off' : 'mdi-eye'"
18
- class="cursor-pointer"
19
- @click="isPwd = !isPwd"
20
- />
21
- </template>
22
- <q-btn class="q-ma-md float-right" color="accent" label="Valider" unelevated @click="submitPasswordLost"/>
20
+ <q-btn
21
+ class="q-ma-md float-right connexion-btn"
22
+ color="accent"
23
+ label="Envoyer"
24
+ rounded
25
+ unelevated
26
+ @click="submitPasswordLost"
27
+ />
28
+ <q-btn
29
+ flat
30
+ color="accent"
31
+ type="a"
32
+ label="Retour à l'écran de connexion"
33
+ @click="onClickBackLogin"
34
+ />
35
+ <div class="text-logo">
36
+ <a href="https://www.oniti.fr/"><img alt="Oniti.fr" :src="getLogoBottomImage()" /></a>
37
+ </div>
23
38
  </q-card>
24
39
  </div>
25
40
  </template>
@@ -31,7 +46,7 @@ import { useRouter } from 'vue-router'
31
46
  const $auth = inject('vlank-auth')
32
47
  const $router = useRouter()
33
48
 
34
- const login = ref('')
49
+ const login = ref(null)
35
50
 
36
51
  const submitPasswordLost = function () {
37
52
  $auth.passwordLost({
@@ -44,19 +59,52 @@ const submitPasswordLost = function () {
44
59
  const getLogoImage = function () {
45
60
  return require('vlank-auth-logo')
46
61
  }
62
+
63
+ const getLogoBottomImage = function () {
64
+ return require('vlank-auth-logo-text')
65
+ }
66
+
67
+ const onClickBackLogin = function () {
68
+ $router.push($auth.getLoginRoute())
69
+ }
47
70
  </script>
48
71
 
49
- <style lang="sass">
50
- .container
51
- .q-card
52
- .logo
53
- width: 80px
54
- margin-left: auto
55
- margin-right: auto
56
-
57
- @media(max-width: 768px)
58
- .container
59
- left: 0
60
- width: 100%
61
- transform: translate(0, -50%)
72
+ <style lang="scss" scoped>
73
+ .login-form-container {
74
+ border-radius: 40px;
75
+ min-width: 415px;
76
+ }
77
+
78
+ .connexion-btn {
79
+ padding: 15px
80
+ }
81
+
82
+ .logo {
83
+ width: 140px;
84
+ top: -120px;
85
+ }
86
+
87
+ .container {
88
+ .q-card {
89
+ .logo {
90
+ width: 12rem;
91
+ margin-left: auto;
92
+ margin-right: auto;
93
+ margin-bottom: -90px;
94
+ }
95
+ }
96
+ }
97
+
98
+ p {
99
+ color: black;
100
+ margin-bottom: 40px;
101
+ }
102
+
103
+ @media(max-width: 768px) {
104
+ .container {
105
+ left: 0;
106
+ width: 100%;
107
+ transform: translate(0, -50%);
108
+ }
109
+ }
62
110
  </style>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <div class="absolute-center container">
3
- <q-card class="fit column q-pa-lg">
4
- <img alt="" class="logo q-mb-md" :src="getLogoImage()" />
3
+ <q-card class="fit column q-pa-lg login-form-container">
4
+ <q-img alt="" class="logo q-mb-md" :src="getLogoImage()" />
5
5
  <vlank-input
6
6
  v-model="new_password"
7
- :type="isPwd ? 'password' : 'text'"
8
- class="q-ml-md q-mr-md login"
9
- label="Mot de passe"
7
+ outlined
8
+ rounded
9
+ class="login"
10
+ color="primary q-mb-md"
11
+ label="Nouveau mot de passe"
10
12
  name="new_password"
13
+ :type="isNewPwd ? 'password' : 'text'"
11
14
  @enter-press="submitPassword"
12
15
  >
13
16
  <template v-slot:prepend>
@@ -15,38 +18,45 @@
15
18
  </template>
16
19
  <template v-slot:append>
17
20
  <q-icon
18
- :name="isPwd ? 'mdi-eye-off' : 'mdi-eye'"
21
+ :name="isNewPwd ? 'visibility_off' : 'visibility'"
19
22
  class="cursor-pointer"
20
- @click="isPwd = !isPwd"
23
+ @click="isNewPwd = !isNewPwd"
21
24
  />
22
25
  </template>
23
26
  </vlank-input>
24
27
  <vlank-input
25
28
  v-model="password_confirm"
26
- :type="isPwd ? 'password' : 'text'"
27
- class="q-ml-md q-mr-md login"
28
- label="Confirmation"
29
+ outlined
30
+ rounded
31
+ class="login"
32
+ color="primary q-mb-md"
33
+ label="Confirmation du mot de passe"
29
34
  name="password_confirm"
35
+ :type="isConfirmPwd ? 'password' : 'text'"
30
36
  @enter-press="submitPassword"
31
37
  >
32
38
  <template v-slot:prepend>
33
- <q-icon name="mdi-lock" />
39
+ <q-icon name="mdi-check" />
34
40
  </template>
35
41
  <template v-slot:append>
36
42
  <q-icon
37
- :name="isPwd ? 'mdi-eye-off' : 'mdi-eye'"
43
+ :name="isConfirmPwd ? 'visibility_off' : 'visibility'"
38
44
  class="cursor-pointer"
39
- @click="isPwd = !isPwd"
45
+ @click="isConfirmPwd = !isConfirmPwd"
40
46
  />
41
47
  </template>
42
48
  </vlank-input>
43
49
  <q-btn
44
- class="q-ma-md float-right"
50
+ class="q-ma-md float-right connexion-btn"
45
51
  color="accent"
46
- label="Valider"
52
+ label="Envoyer"
53
+ rounded
47
54
  unelevated
48
55
  @click="submitPassword"
49
56
  />
57
+ <div class="text-logo">
58
+ <a href="https://www.oniti.fr/"><img alt="Oniti.fr" :src="getLogoBottomImage()" /></a>
59
+ </div>
50
60
  </q-card>
51
61
  </div>
52
62
  </template>
@@ -63,55 +73,85 @@ const store = useStore()
63
73
  const $q = useQuasar()
64
74
  const $auth = inject('vlank-auth')
65
75
 
66
- const isPwd = ref(true)
76
+ const isNewPwd = ref(true)
77
+ const isConfirmPwd = ref(true)
67
78
  const token = ref($route.params.token)
68
79
  const new_password = ref("")
69
80
  const password_confirm = ref("")
70
81
 
71
82
  const has_check = computed(() => {
72
- return store.state.auth.has_check
83
+ return store.state.auth.has_check
73
84
  })
74
85
 
75
86
  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
- });
87
+ $auth.resetPassword({
88
+ new_password: new_password.value,
89
+ password_confirm: password_confirm.value,
90
+ token: token.value
91
+ }).then(()=> {
92
+ $router.push($auth.getLoginRoute())
93
+ });
83
94
  }
84
95
 
85
96
  const getLogoImage = function () {
86
97
  return require('vlank-auth-logo')
87
98
  }
88
99
 
100
+ const getLogoBottomImage = function () {
101
+ return require('vlank-auth-logo-text')
102
+ }
103
+
89
104
  watch(has_check, (newValue, oldValue) => {
90
- if(newValue) {
91
- $q.loading.hide();
92
- }
105
+ if(newValue) {
106
+ $q.loading.hide();
107
+ }
93
108
  })
94
109
 
95
110
  onMounted(() => {
96
- if(!store.state.auth.has_check){
97
- $q.loading.show({
98
- delay: 0, // ms
99
- })
100
- }
111
+ if(!store.state.auth.has_check){
112
+ $q.loading.show({
113
+ delay: 0, // ms
114
+ })
115
+ }
101
116
  })
102
117
  </script>
103
118
 
104
- <style lang="sass">
105
- .container
106
- .q-card
107
- .logo
108
- width: 80px
109
- margin-left: auto
110
- margin-right: auto
119
+ <style lang="scss" scoped>
120
+ .login-form-container {
121
+ border-radius: 40px;
122
+ min-width: 415px;
123
+ }
124
+
125
+ .connexion-btn {
126
+ padding: 15px
127
+ }
128
+
129
+ .logo {
130
+ width: 140px;
131
+ top: -120px;
132
+ }
111
133
 
112
- @media(max-width: 768px)
113
- .container
114
- left: 0
115
- width: 100%
116
- transform: translate(0, -50%)
134
+ .container {
135
+ .q-card {
136
+ .logo {
137
+ width: 12rem;
138
+ margin-left: auto;
139
+ margin-right: auto;
140
+ margin-bottom: -90px;
141
+ }
142
+ }
143
+ }
144
+
145
+ p {
146
+ color: black;
147
+ margin-bottom: 40px;
148
+ }
149
+
150
+ @media(max-width: 768px) {
151
+ .container {
152
+ left: 0;
153
+ width: 100%;
154
+ transform: translate(0, -50%);
155
+ }
156
+ }
117
157
  </style>