annotate client/src/views/Login.vue @ 539:924490b3395b

refac: Loginmask reworked The login is now more stable. The user gets better visual feedback for his actions.
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 30 Aug 2018 12:39:09 +0200
parents f96d18e53369
children ee86ab038a7e
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>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
2 <div class="d-flex flex-column login shadow-lg">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
3 <div class="loginmask">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
4 <!-- logo section -->
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
5 <div class="d-flex flex-row justify-content-center mb-3">
25
a728610b3812 Add Light visual hints
Thomas Junk <thomas.junk@intevation.de>
parents: 24
diff changeset
6 <div class="logo"><img src="../assets/logo.png"></div>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
7 <div class="title">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
8 <h1>{{ appTitle }}</h1>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
9 </div>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 </div>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
11 <!-- end logo section -->
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
12 <div id="alert" :style="errorMessageStyle" :class="errorMessageClass" role="alert">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
13 <span>{{ errorMessage }}</span>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
14 </div>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
15 <form @submit.prevent="login">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
16 <div class="input-group mb-3">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
17 <input type="text" v-model="user" id="inputUsername" class="form-control shadow-sm" :placeholder="usernameLabel" required autofocus>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
18 </div>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
19 <div class="input-group mb-3">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
20 <input :type="isPasswordVisible" v-model="password" id="inputPassword" class="form-control shadow-sm" :placeholder='passwordLabel' :required='!showPasswordReset' :disabled='showPasswordReset'>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
21 <div class="input-group-append">
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
22 <span class="input-group-text disabled" id="basic-addon2" @click="showPassword">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
23 <i :class="eyeIcon"></i>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
24 </span>
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
25 </div>
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 10
diff changeset
26 </div>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
27 <button v-if="showPasswordReset==false" class="btn btn-primary btn-block shadow-sm" :disabled="submitted || showPasswordReset" type="submit">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
28 <translate>Login</translate>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
29 </button>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 </form>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
31
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
32 <!-- password forgotten part -->
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
33 <form class="">
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
34 <div v-if="showPasswordReset" class="passwordreset">
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
35 <button class="btn btn-block btn-info" type="button" @click="resetPassword">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
36 <translate>Request password reset!</translate>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
37 </button>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
38 <div class="pull-right">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
39 <a href="#" @click.prevent="togglePasswordReset">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
40 <translate>back to login</translate>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
41 </a>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
42 </div>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
43 </div>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
44 <div v-else class="pull-right">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
45 <a href="#" @click.prevent="togglePasswordReset">
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
46 <translate>Forgot password</translate>
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
47 </a>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
48 </div>
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
49 </form>
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
50
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
51 <!-- bottom logo section -->
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
52 <div><img :src="secondaryLogo"></div>
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
53 </div>
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
54 </div>
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
55 </template>)
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56
9
ee6d3836014e current version of login
Thomas Junk <thomas.junk@intevation.de>
parents: 6
diff changeset
57 <style lang="scss">
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
58 @import "../assets/application.scss";
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
59
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
60 .login {
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
61 background-color: white;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
62 min-width: 375px;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
63 height: 500px;
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
64 @extend %fully-centered;
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
65 }
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
66
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
67 .loginmask {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
68 margin-left: $large-offset;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
69 margin-right: $large-offset;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
70 margin-top: $large-offset;
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
71 }
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
72
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
73 .logo {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
74 margin-right: $offset;
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
75 }
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
76
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
77 .alert {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
78 padding: 0.5rem;
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
79 }
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 </style>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
82 <script>
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
83 import { mapGetters } from "vuex";
534
f96d18e53369 Client: add passwordrest api call.
Bernhard Reiter <bernhard@intevation.de>
parents: 529
diff changeset
84 import { HTTP } from "../lib/http";
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
86 export default {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
87 name: "login",
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
88 data() {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
89 return {
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
90 user: "",
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
91 password: "",
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
92 submitted: false,
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
93 loginFailed: false,
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
94 passwordJustResetted: false,
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
95 readablePassword: false,
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
96 showPasswordReset: false,
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
97 usernameToReset: ""
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
98 };
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
99 },
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
100 computed: {
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
101 errorMessage() {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
102 if (this.loginFailed) return this.$gettext("Login failed");
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
103 if (this.passwordJustResetted)
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
104 return this.$gettext("Password reset requested!");
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
105 return "&npsp;";
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
106 },
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
107 passwordLabel() {
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
108 return this.$gettext("Enter passphrase");
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
109 },
505
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
110 usernameLabel() {
61170d775158 Do not call the username email
Tom Gottfried <tom@intevation.de>
parents: 485
diff changeset
111 return this.$gettext("Enter username");
154
2ba329e82fb0 Wrap vue templates with translation in parentheses
Thomas Junk <thomas.junk@intevation.de>
parents: 150
diff changeset
112 },
117
5e95c62a7e74 Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents: 33
diff changeset
113 isPasswordVisible() {
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
114 return this.readablePassword ? "text" : "password";
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
115 },
122
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
116 eyeIcon() {
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
117 return {
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
118 fa: true,
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
119 "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
120 "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
121 };
da279a0ce127 The "eye" icon changes into a "crossed out eye" icon
Thomas Junk <thomas.junk@intevation.de>
parents: 117
diff changeset
122 },
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
123 errorMessageStyle() {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
124 if (this.loginFailed || this.passwordJustResetted) {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
125 return "visibility:visible";
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
126 }
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
127 return "visibility:hidden";
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
128 },
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
129 errorMessageClass() {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
130 let result = {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
131 "mb-3": true,
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
132 errormessage: true,
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
133 alert: true
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
134 };
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
135 if (this.loginFailed) {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
136 result["alert-danger"] = true;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
137 }
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
138 if (this.passwordJustResetted) {
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
139 result["alert-info"] = true;
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
140 }
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
141 return result;
32
0c19dcc352f9 Dynamic height of dialogbox
Thomas Junk <thomas.junk@intevation.de>
parents: 25
diff changeset
142 },
141
Thomas Junk <thomas.junk@intevation.de>
parents: 122
diff changeset
143 ...mapGetters("application", ["appTitle", "secondaryLogo"])
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
144 },
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
145 methods: {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
146 login() {
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
147 this.submitted = true;
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
148 this.passwordJustResetted = false;
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
149 const { user, password } = this;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
150 this.$store
158
992e17912405 feat: Improve login against real db
Thomas Junk <thomas.junk@intevation.de>
parents: 154
diff changeset
151 .dispatch("user/login", { user, password })
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
152 .then(() => {
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
153 this.loginFailed = false;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
154 this.$router.push("/");
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
155 })
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
156 .catch(() => {
10
361ae8211991 refactored to component local state
Thomas Junk <thomas.junk@intevation.de>
parents: 9
diff changeset
157 this.loginFailed = true;
6
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
158 this.submitted = false;
7c1bde663c8e current frontend
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
159 });
33
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
160 },
ae6535d44563 Make password readable. Moved Layout to separate file.
Thomas Junk <thomas.junk@intevation.de>
parents: 32
diff changeset
161 showPassword() {
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
162 // disable button when in reset mode
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
163 if (!this.showPasswordReset) {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
164 this.readablePassword = !this.readablePassword;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
165 }
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
166 },
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
167 togglePasswordReset() {
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
168 this.passwordJustResetted = false;
485
7a8644e9e50e client: add (unwired) password reset form
Bernhard Reiter <bernhard@intevation.de>
parents: 166
diff changeset
169 this.showPasswordReset = !this.showPasswordReset;
539
924490b3395b refac: Loginmask reworked
Thomas Junk <thomas.junk@intevation.de>
parents: 534
diff changeset
170 this.loginFailed = false;
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
171 },
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
172 resetPassword() {
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
173 if (this.user) {
534
f96d18e53369 Client: add passwordrest api call.
Bernhard Reiter <bernhard@intevation.de>
parents: 529
diff changeset
174 HTTP.post("/users/passwordreset", { user: this.user }).catch(error => {
f96d18e53369 Client: add passwordrest api call.
Bernhard Reiter <bernhard@intevation.de>
parents: 529
diff changeset
175 console.log("backend problem", error);
f96d18e53369 Client: add passwordrest api call.
Bernhard Reiter <bernhard@intevation.de>
parents: 529
diff changeset
176 });
529
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
177 this.togglePasswordReset();
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
178 this.passwordJustResetted = true;
b07763345352 client: add more password reset ui
Bernhard Reiter <bernhard@intevation.de>
parents: 505
diff changeset
179 }
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
180 }
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
181 }
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
182 };
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
183 </script>