annotate client/src/views/Login.vue @ 529:b07763345352

client: add more password reset ui * Add user interface to show a password reset button that relies on the already entered user name. Not yet wired. Not yet using the same HTML form verification for the user name input.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 28 Aug 2018 12:30:41 +0200
parents 61170d775158
children f96d18e53369
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
1 (<template>
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
2 <div :class="loginStyle">
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 <div>
25
a728610b3812 Add Light visual hints
Thomas Junk <thomas.junk@intevation.de>
parents: 24
diff changeset
4 <div class="logogroup d-flex flex-row justify-content-center">
a728610b3812 Add Light visual hints
Thomas Junk <thomas.junk@intevation.de>
parents: 24
diff changeset
5 <div class="logo"><img src="../assets/logo.png"></div>
9
ee6d3836014e current version of login
Thomas Junk <thomas.junk@intevation.de>
parents: 6
diff changeset
6 <div class="title"><h1>{{ appTitle }}</h1></div>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 </div>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 </div>
17
7d242100af46 Adjusted the look and feel of the login page according to ISC
Thomas Junk <thomas.junk@intevation.de>
parents: 13
diff changeset
9 <div class="login-wrapper d-flex flex-row justify-content-center">
9
ee6d3836014e current version of login
Thomas Junk <thomas.junk@intevation.de>
parents: 6
diff changeset
10 <form class="loginform form-signin" @submit.prevent="login">
166
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 158
diff changeset
11 <div id="alert" v-if="loginFailed" class="loginerrormessage alert alert-danger" role="alert">
150
44a7e27a0816 Added missing translation for loginerror
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
12 <span class="loginerror"><translate>Login failed</translate></span>
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
13 </div>
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
14 <div id="alert" v-if="passwordJustResetted"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
15 class="loginerrormessage alert alert-danger" role="alert">
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
16 <span class="loginerror"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
17 ><translate>Password reset requested!</translate></span>
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
18 </div>
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
19 <div class="input-group mb-3 usernamegroup">
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
20 <input type="text" v-model="user" id="inputUsername" class="form-control" :placeholder="usernameLabel" required autofocus>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
21 </div>
25
a728610b3812 Add Light visual hints
Thomas Junk <thomas.junk@intevation.de>
parents: 24
diff changeset
22 <div class="input-group mb-3 passwordgroup">
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
23 <input :type="isPasswordVisible" v-model="password"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
24 id="inputPassword" class="form-control"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
25 :placeholder='passwordLabel'
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
26 :required='!showPasswordReset' :disabled='showPasswordReset'>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
27 <div class="input-group-append">
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
28 <span class="input-group-text disabled" id="basic-addon2"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
29 @click="showPassword"><i :class="eyeIcon"></i></span>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
30 </div>
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
31 </div>
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
32 <button class="submitbutton btn btn-primary btn-block"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
33 :disabled="submitted || showPasswordReset" type="submit"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
34 ><translate>Login</translate></button>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 </form>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 </div>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
37
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
38 <!-- password forgotten part -->
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
39 <div class="d-flex flex-row justify-content-center">
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
40 <form class="loginform form-signin">
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
41 <div v-if="showPasswordReset" class="passwordreset">
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
42 <!--
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
43 TODO text and action for password reset
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
44 <div class="input-group mb-3 usernamegroup">
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
45 <input type="text" v-model="usernameToReset" class="form-control" :placeholder="usernameLabel" required>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
46 </div>
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
47 -->
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
48 <button class="btn btn-warning btn-block" type="button"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
49 @click="resetPassword"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
50 ><translate>Request password reset!</translate></button>
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
51 <div class="forgottenlink small">
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
52 <a href="#" @click.prevent="togglePasswordReset"
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
53 ><translate>back to login</translate></a></div>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
54 </div>
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
55 <div v-else class="forgottenlink small">
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
56 <a href="#" @click.prevent="togglePasswordReset"
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
57 ><translate>Forgot password</translate></a></div>
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
58 </form>
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
59 </div>
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
60
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
61 <!-- bottom logo section -->
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
62 <div class="secondary-logo d-flex flex-row justify-content-center"
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
63 ><img :src="secondaryLogo"></div>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 </div>
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
65 </template>)
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66
9
ee6d3836014e current version of login
Thomas Junk <thomas.junk@intevation.de>
parents: 6
diff changeset
67 <style lang="scss">
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
68 @import "../assets/application.scss";
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
69 $logincollapsed: 470px;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
70 $loginextended: 550px;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
71
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
72 .usernamegroup {
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
73 box-shadow: $basic-shadow-light !important;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
74 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
75 .forgottenlink {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
76 text-align: right;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
77 margin-top: $small-offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
78 margin-bottom: $small-offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
79 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
80 #inputPassword {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
81 border-right: none;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
82 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
83 .input-group-text {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
84 background-color: white !important;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
85 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
86
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
87 .login {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
88 width: 375px;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
89 @extend %fully-centered;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
90 padding-top: $offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
91 padding-bottom: $offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
92 box-shadow: $basic-shadow;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
93 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
94 .logincollapsed {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
95 height: $logincollapsed;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
96 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
97
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
98 .loginextended {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
99 height: $loginextended;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
100 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
101 .loginerror {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
102 white-space: pre;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
103 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
104 .loginerrormessage {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
105 box-shadow: $basic-shadow-light !important;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
106 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
107 .loginform {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
108 width: 300px;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
109 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
110 .logogroup {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
111 margin-top: $offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
112 margin-bottom: $offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
113 }
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
114 .passwordreset {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
115 margin-top: $offset;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
116 margin-bottom: $offset;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
117 }
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
118 .mail-icon {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
119 width: $iconwidth;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
120 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
121 .passwordgroup {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
122 box-shadow: $basic-shadow-light !important;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
123 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
124 .password-icon {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
125 position: relative;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
126 top: 10px;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
127 font-size: $iconsize;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
128 line-height: $iconLineHeight;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
129 width: $iconwidth;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
130 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
131 .submitbutton {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
132 box-shadow: $basic-shadow-light !important;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
133 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
134 .title {
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
135 margin-left: $offset;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
136 }
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
137 </style>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
138
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
139 <script>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
140 import { mapGetters } from "vuex";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
141
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
142 export default {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
143 name: "login",
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
144 data() {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
145 return {
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
146 user: "",
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
147 password: "",
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
148 submitted: false,
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
149 loginFailed: false,
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
150 passwordJustResetted: false,
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
151 readablePassword: false,
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
152 showPasswordReset: false,
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
153 usernameToReset: ""
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
154 };
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
155 },
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
156 computed: {
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
157 passwordLabel() {
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
158 return this.$gettext("Enter passphrase");
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
159 },
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
160 usernameLabel() {
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
161 return this.$gettext("Enter username");
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
162 },
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
163 isPasswordVisible() {
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
164 return this.readablePassword ? "text" : "password";
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
165 },
122
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
166 eyeIcon() {
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
167 return {
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
168 fa: true,
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
169 "fa-eye": !this.readablePassword,
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
170 "fa-eye-slash": this.readablePassword
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
171 };
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
172 },
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
173 loginStyle() {
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
174 return {
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
175 login: true,
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
176 logincollapsed: !this.loginFailed,
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
177 loginextended: this.loginFailed,
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
178 "bg-white": true,
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
179 rounded: true
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
180 };
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
181 },
141
Thomas Junk <thomas.junk@intevation.de>
parents: 122
diff changeset
182 ...mapGetters("application", ["appTitle", "secondaryLogo"])
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
183 },
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
184 methods: {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
185 login() {
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
186 this.submitted = true;
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
187 this.passwordJustResetted = false;
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
188 const { user, password } = this;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
189 this.$store
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
190 .dispatch("user/login", { user, password })
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
191 .then(() => {
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
192 this.loginFailed = false;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
193 this.$router.push("/");
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
194 })
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
195 .catch(() => {
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
196 this.loginFailed = true;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
197 this.submitted = false;
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
198 });
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
199 },
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
200 showPassword() {
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
201 // disable button when in reset mode
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
202 if (!this.showPasswordReset) {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
203 this.readablePassword = !this.readablePassword;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
204 }
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
205 },
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
206 togglePasswordReset() {
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
207 this.passwordJustResetted = false;
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
208 this.showPasswordReset = !this.showPasswordReset;
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
209 },
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
210 resetPassword() {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
211 if (this.user) {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
212 console.log("FIXME send reset password to api");
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
213 this.togglePasswordReset();
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
214 this.passwordJustResetted = true;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
215 }
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
216 }
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
217 }
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
218 };
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
219 </script>