|
18 | 18 | </div>
|
19 | 19 | </v-container>
|
20 | 20 | </v-card-title>
|
21 |
| - <v-card-text class="px-0 pb-0"> |
22 |
| - <alerts |
23 |
| - :success="success" |
24 |
| - success-msg="Successfully logged in!" |
25 |
| - :error="error" |
26 |
| - :error-msg="errorMsg" |
27 |
| - /> |
28 |
| - |
29 |
| - <v-form v-model="valid"> |
30 |
| - <v-text-field |
31 |
| - v-model="username" |
32 |
| - autocomplete="username" |
33 |
| - label="Username" |
34 |
| - name="username" |
35 |
| - append-icon="mdi-account" |
36 |
| - type="text" |
37 |
| - required |
38 |
| - outlined |
39 |
| - :rules="[() => !!username || 'This field is required']" |
40 |
| - :placeholder="placeholder" |
41 |
| - @keyup.enter="login" |
42 |
| - /> |
43 |
| - |
44 |
| - <v-text-field |
45 |
| - id="password" |
46 |
| - v-model="password" |
47 |
| - autocomplete="current-password" |
48 |
| - label="Password" |
49 |
| - name="password" |
50 |
| - append-icon="mdi-lock" |
51 |
| - type="password" |
52 |
| - required |
53 |
| - outlined |
54 |
| - :rules="[() => !!password || 'This field is required']" |
55 |
| - :placeholder="placeholder" |
56 |
| - @keyup.enter="login" |
57 |
| - /> |
58 |
| - </v-form> |
59 |
| - </v-card-text> |
60 | 21 | <v-card-actions
|
| 22 | + v-if="providers.length !== 0" |
61 | 23 | id="btn-container"
|
62 | 24 | class="d-flex justify-center flex-column"
|
63 | 25 | >
|
64 |
| - <v-btn |
65 |
| - id="login-btn" |
66 |
| - block |
67 |
| - x-large |
68 |
| - color="primary" |
69 |
| - @click="login" |
70 |
| - > |
71 |
| - Login |
72 |
| - </v-btn> |
73 | 26 | <v-btn
|
74 | 27 | block
|
75 | 28 | x-large
|
|
78 | 31 | >
|
79 | 32 | SSO login
|
80 | 33 | </v-btn>
|
| 34 | + <a |
| 35 | + href="#" |
| 36 | + class="text-button text-no-wrap" |
| 37 | + @click.prevent="toggleOtherLoginOptions" |
| 38 | + > |
| 39 | + {{ optionsShow ? 'Hide other options' : 'Show other options' }} |
| 40 | + </a> |
81 | 41 | </v-card-actions>
|
| 42 | + <v-expand-transition> |
| 43 | + <v-responsive |
| 44 | + v-if="optionsShow" |
| 45 | + > |
| 46 | + <v-card-text class="px-0 pb-0"> |
| 47 | + <alerts |
| 48 | + :success="success" |
| 49 | + success-msg="Successfully logged in!" |
| 50 | + :error="error" |
| 51 | + :error-msg="errorMsg" |
| 52 | + /> |
| 53 | + <v-form v-model="valid"> |
| 54 | + <v-text-field |
| 55 | + v-model="username" |
| 56 | + autocomplete="username" |
| 57 | + label="Username" |
| 58 | + name="username" |
| 59 | + append-icon="mdi-account" |
| 60 | + type="text" |
| 61 | + required |
| 62 | + outlined |
| 63 | + :rules="[() => !!username || 'This field is required']" |
| 64 | + :placeholder="placeholder" |
| 65 | + @keyup.enter="login" |
| 66 | + /> |
| 67 | + |
| 68 | + <v-text-field |
| 69 | + id="password" |
| 70 | + v-model="password" |
| 71 | + autocomplete="current-password" |
| 72 | + label="Password" |
| 73 | + name="password" |
| 74 | + append-icon="mdi-lock" |
| 75 | + type="password" |
| 76 | + required |
| 77 | + outlined |
| 78 | + :rules="[() => !!password || 'This field is required']" |
| 79 | + :placeholder="placeholder" |
| 80 | + @keyup.enter="login" |
| 81 | + /> |
| 82 | + </v-form> |
| 83 | + </v-card-text> |
| 84 | + <v-card-actions |
| 85 | + id="btn-container" |
| 86 | + class="d-flex justify-center flex-column" |
| 87 | + > |
| 88 | + <v-btn |
| 89 | + id="login-btn" |
| 90 | + block |
| 91 | + x-large |
| 92 | + color="primary" |
| 93 | + @click="login" |
| 94 | + > |
| 95 | + Login |
| 96 | + </v-btn> |
| 97 | + </v-card-actions> |
| 98 | + </v-responsive> |
| 99 | + </v-expand-transition> |
82 | 100 | </v-card>
|
83 | 101 | </v-col>
|
84 | 102 | </v-row>
|
@@ -142,7 +160,8 @@ export default {
|
142 | 160 | valid: false,
|
143 | 161 | providers: [],
|
144 | 162 | dialog: false,
|
145 |
| - on: false |
| 163 | + on: false, |
| 164 | + optionsShow: false |
146 | 165 | };
|
147 | 166 | },
|
148 | 167 |
|
@@ -177,6 +196,9 @@ export default {
|
177 | 196 | this.dialog = true;
|
178 | 197 | this.on = true;
|
179 | 198 | },
|
| 199 | + toggleOtherLoginOptions() { |
| 200 | + this.optionsShow = !this.optionsShow; |
| 201 | + }, |
180 | 202 | login() {
|
181 | 203 | if (!this.valid) return;
|
182 | 204 |
|
@@ -205,6 +227,7 @@ export default {
|
205 | 227 | if (providers) {
|
206 | 228 | this.providers = providers;
|
207 | 229 | }
|
| 230 | + this.optionsShow = this.providers.length === 0; |
208 | 231 | }).catch(err => {
|
209 | 232 | this.errorMsg = `Providers list was passed incorrectly. ${err.message}`;
|
210 | 233 | this.error = true;
|
|
0 commit comments