@tapni/auth 0.0.170 → 0.0.172
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 +2 -0
- package/dist/.vite/manifest.json +18 -10
- package/dist/.well-known/assetlinks.json +10 -12
- package/dist/.well-known/microsoft-identity-association.json +5 -5
- package/dist/{Account-6F9eRo1R.js → Account-BVGvxZ85.js} +31 -32
- package/dist/{QR-2Izy5Dj4.js → QR-DwjajyG2.js} +3 -3
- package/dist/TapniAuth.es.js +1 -1
- package/dist/TapniAuth.umd.js +9 -9
- package/dist/blank.html +31 -0
- package/dist/{install-co2F1hxN.js → install-B8fBS6C4.js} +752 -996
- package/dist/site.webmanifest +11 -1
- package/dist/style.css +1 -1
- package/dist/{web-NrPZl3qD.js → web-XbruGdlD.js} +2 -5
- package/package.json +64 -55
- package/src/.prettierrc.json +16 -0
- package/src/App.vue +249 -265
- package/src/components/Language.vue +66 -143
- package/src/components/LinkIcon.vue +174 -225
- package/src/components/ModalOverlay.vue +47 -50
- package/src/components/OTP.vue +64 -94
- package/src/components/SSO.vue +80 -111
- package/src/components/SSOPick.vue +93 -148
- package/src/eslint.config.js +15 -0
- package/src/install.js +9 -10
- package/src/main.js +54 -57
- package/src/mixins/apple.mixin.js +56 -54
- package/src/mixins/auth.mixin.js +21 -74
- package/src/mixins/facebook.mixin.js +67 -66
- package/src/mixins/global.mixin.js +107 -109
- package/src/mixins/google.mixin.js +53 -54
- package/src/mixins/mfa-auth.mixin.js +68 -68
- package/src/mixins/microsoft.mixin.js +67 -75
- package/src/mixins/okta.mixin.js +50 -57
- package/src/mixins/qr-auth.mixin.js +111 -107
- package/src/mixins/saml.mixin.js +97 -48
- package/src/router/index.js +6 -6
- package/src/routes.js +60 -66
- package/src/services/Api.js +55 -57
- package/src/services/AuthService.js +75 -75
- package/src/services/CompanyService.js +10 -10
- package/src/services/DeviceService.js +3 -3
- package/src/services/UserService.js +45 -45
- package/src/services/UtilService.js +256 -218
- package/src/store/auth.js +471 -543
- package/src/store/constants.js +1 -1
- package/src/store/event-bus.js +22 -22
- package/src/store/locales/cn.js +442 -458
- package/src/store/locales/de.js +438 -517
- package/src/store/locales/en.js +449 -510
- package/src/store/locales/es.js +442 -524
- package/src/store/locales/fr.js +442 -516
- package/src/store/locales/it.js +442 -514
- package/src/store/locales/kr.js +442 -491
- package/src/store/locales/lang.js +43 -43
- package/src/store/locales/sr.js +439 -492
- package/src/store/locales/tr.js +436 -487
- package/src/store/store.js +6 -6
- package/src/views/Account.vue +169 -207
- package/src/views/Callback.vue +36 -33
- package/src/views/Login.vue +220 -392
- package/src/views/MFA.vue +89 -103
- package/src/views/QR.vue +25 -28
- package/src/views/Register.vue +201 -205
- package/src/views/Reset.vue +132 -135
- package/src/views/Verify.vue +153 -151
- package/src/views/Welcome.vue +61 -60
- /package/dist/{web-L3jORB19.js → web-AXRKjAOB.js} +0 -0
- /package/dist/{web-5VtGcKeU.js → web-IFGkBi0t.js} +0 -0
- /package/dist/{web-AImUTDQQ.js → web-LIfHmYL2.js} +0 -0
package/src/views/Login.vue
CHANGED
|
@@ -1,400 +1,228 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<a
|
|
113
|
-
@click="googleLogin"
|
|
114
|
-
v-if="displayGoogleLogin"
|
|
115
|
-
class="button-center button button-90 google-button pointer"
|
|
116
|
-
>
|
|
117
|
-
<img
|
|
118
|
-
src="https://cdn.tapni.co/icons/g-logo.png"
|
|
119
|
-
style="
|
|
120
|
-
position: absolute;
|
|
121
|
-
margin-left: -10px;
|
|
122
|
-
padding: 8px 0;
|
|
123
|
-
height: 100%;
|
|
124
|
-
"
|
|
125
|
-
/>
|
|
126
|
-
<span v-if="!googleLoad"
|
|
127
|
-
>{{ ssoLang[appLanguage].sign_in_with }} Google</span
|
|
128
|
-
>
|
|
129
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
130
|
-
</a>
|
|
131
|
-
|
|
132
|
-
<!-- Facebook Login Button -->
|
|
133
|
-
<a
|
|
134
|
-
@click="facebookLogin"
|
|
135
|
-
v-if="displayFacebookLogin"
|
|
136
|
-
class="button-center button button-90 google-button pointer"
|
|
137
|
-
>
|
|
138
|
-
<img
|
|
139
|
-
src="https://cdn.tapni.co/icons/facebook-blue.png"
|
|
140
|
-
style="
|
|
141
|
-
position: absolute;
|
|
142
|
-
margin-left: -9px;
|
|
143
|
-
padding: 10px 0;
|
|
144
|
-
height: 100%;
|
|
145
|
-
"
|
|
146
|
-
/>
|
|
147
|
-
<span v-if="!facebookLoad"
|
|
148
|
-
>{{ ssoLang[appLanguage].sign_in_with }} Facebook</span
|
|
149
|
-
>
|
|
150
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
151
|
-
</a>
|
|
152
|
-
|
|
153
|
-
<!-- Microsoft Login Button -->
|
|
154
|
-
<a
|
|
155
|
-
@click="microsoftLogin"
|
|
156
|
-
v-if="!displayMicrosoftSSOLogin"
|
|
157
|
-
class="button-center button button-90 google-button pointer"
|
|
158
|
-
>
|
|
159
|
-
<img
|
|
160
|
-
src="https://cdn.tapni.co/icons/outlook.png"
|
|
161
|
-
style="
|
|
162
|
-
position: absolute;
|
|
163
|
-
margin-left: -8px;
|
|
164
|
-
padding: 10px 0;
|
|
165
|
-
height: 100%;
|
|
166
|
-
"
|
|
167
|
-
/>
|
|
168
|
-
<span v-if="!microsoftLoad"
|
|
169
|
-
>{{ ssoLang[appLanguage].sign_in_with }} Outlook</span
|
|
170
|
-
>
|
|
171
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
172
|
-
</a>
|
|
173
|
-
|
|
174
|
-
<!-- Microsoft SSO Button -->
|
|
175
|
-
<a
|
|
176
|
-
@click="ssoLogin"
|
|
177
|
-
v-if="!displayMicrosoftSSOLogin"
|
|
178
|
-
class="button-center button button-90 google-button pointer"
|
|
179
|
-
>
|
|
180
|
-
<img
|
|
181
|
-
src="https://cdn.tapni.co/icons/sso-key.png"
|
|
182
|
-
style="
|
|
183
|
-
position: absolute;
|
|
184
|
-
margin-left: -8px;
|
|
185
|
-
padding: 10px 0;
|
|
186
|
-
height: 100%;
|
|
187
|
-
"
|
|
188
|
-
/>
|
|
189
|
-
<span v-if="!microsoftSSOLoad">{{ ssoLang[appLanguage].sign_in_with }} SSO</span>
|
|
190
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
191
|
-
</a>
|
|
192
|
-
<!-- Microsoft SSO Button -->
|
|
193
|
-
<a
|
|
194
|
-
@click="microsoftLogin('sso')"
|
|
195
|
-
v-if="displayMicrosoftSSOLogin"
|
|
196
|
-
class="button-center button button-90 google-button pointer"
|
|
197
|
-
>
|
|
198
|
-
<img
|
|
199
|
-
src="https://cdn.tapni.co/icons/sso-key.png"
|
|
200
|
-
style="
|
|
201
|
-
position: absolute;
|
|
202
|
-
margin-left: -8px;
|
|
203
|
-
padding: 10px 0;
|
|
204
|
-
height: 100%;
|
|
205
|
-
"
|
|
206
|
-
/>
|
|
207
|
-
<span v-if="microsoftSSOLoad">{{ ssoLang[appLanguage].sign_in_with }} SSO</span>
|
|
208
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
209
|
-
</a>
|
|
210
|
-
|
|
211
|
-
<!-- Email Login Button -->
|
|
212
|
-
<a
|
|
213
|
-
@click="emailLogin = true"
|
|
214
|
-
v-if="!displayFormLogin"
|
|
215
|
-
class="button-center button button-90 google-button pointer"
|
|
216
|
-
>
|
|
217
|
-
<img
|
|
218
|
-
src="https://cdn.tapni.co/icons/mail.png"
|
|
219
|
-
style="
|
|
220
|
-
position: absolute;
|
|
221
|
-
margin-left: -8px;
|
|
222
|
-
padding: 12px 0;
|
|
223
|
-
height: 100%;
|
|
224
|
-
"
|
|
225
|
-
/>
|
|
226
|
-
<span>{{ ssoLang[appLanguage].sign_in_with }} Email</span>
|
|
227
|
-
</a>
|
|
228
|
-
|
|
229
|
-
<!-- Google Login Button -->
|
|
230
|
-
<a
|
|
231
|
-
@click="$router.push('/qr')"
|
|
232
|
-
v-if="displayQRLogin"
|
|
233
|
-
class="button-center button button-90 google-button pointer"
|
|
234
|
-
>
|
|
235
|
-
<img
|
|
236
|
-
src="https://cdn.tapni.co/icons/qr.png"
|
|
237
|
-
style="
|
|
238
|
-
position: absolute;
|
|
239
|
-
margin-left: -5px;
|
|
240
|
-
padding: 15px 0;
|
|
241
|
-
height: 100%;
|
|
242
|
-
"
|
|
243
|
-
/>
|
|
244
|
-
<span>{{ ssoLang[appLanguage].sign_in_with }} QR</span>
|
|
245
|
-
</a>
|
|
246
|
-
|
|
247
|
-
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
248
|
-
|
|
249
|
-
<p class="close-text center-text half-top color-black">
|
|
250
|
-
{{ ssoLang[appLanguage].terms_by_signing_in }} <br />
|
|
251
|
-
<a class="" href="https://tapni.com/policies/terms-of-service">{{
|
|
252
|
-
ssoLang[this.appLanguage].terms_of_service
|
|
253
|
-
}}</a>
|
|
254
|
-
{{ ssoLang[appLanguage].and }}
|
|
255
|
-
<a href="https://tapni.com/policies/privacy-policy">{{
|
|
256
|
-
ssoLang[this.appLanguage].privacy_policy
|
|
257
|
-
}}</a>
|
|
258
|
-
</p>
|
|
259
|
-
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
260
|
-
<div v-if="!isModal" class="page-login-links">
|
|
261
|
-
<router-link
|
|
262
|
-
v-if="displayRegisterLogin"
|
|
263
|
-
class="forgot float-right"
|
|
264
|
-
to="/register"
|
|
265
|
-
>{{ ssoLang[appLanguage].create_account }}</router-link
|
|
266
|
-
>
|
|
267
|
-
<router-link
|
|
268
|
-
v-if="displayResetPasswordLogin"
|
|
269
|
-
class="create float-left"
|
|
270
|
-
to="/reset"
|
|
271
|
-
>{{ ssoLang[appLanguage].reset_password }}</router-link
|
|
272
|
-
>
|
|
273
|
-
<div class="clear"></div>
|
|
274
|
-
</div>
|
|
275
|
-
<div v-else class="page-login-links" @click="createAccountModal">
|
|
276
|
-
<a class="forgot center-text pointer small-top"
|
|
277
|
-
>{{ ssoLang[appLanguage].or }} <br />
|
|
278
|
-
{{ ssoLang[appLanguage].create_new_account }}</a
|
|
279
|
-
>
|
|
280
|
-
<div class="clear"></div>
|
|
281
|
-
</div>
|
|
282
|
-
</form>
|
|
2
|
+
<form class="page-login content-boxed content-boxed-padding" @submit.prevent="submit" autocomplete="on" :style="isModal ? 'max-width: 500px;' : ''">
|
|
3
|
+
<a v-if="isModal" @click="close" class="color-black pull-right pointer" style="margin-top: 0px; position: absolute; right: -20px; text-align: right">
|
|
4
|
+
<i class="font-17 color-black">
|
|
5
|
+
<img src="https://cdn.tapni.co/icons/down-arrow.png" class="responsive-image" style="width: 35%" />
|
|
6
|
+
</i>
|
|
7
|
+
</a>
|
|
8
|
+
<h1 class="bold no-bottom center-text" style="margin-top: 63px">
|
|
9
|
+
{{ this.ssoLang[this.appLanguage].login }}
|
|
10
|
+
</h1>
|
|
11
|
+
<p class="half-bottom small-top center-text color-black"></p>
|
|
12
|
+
|
|
13
|
+
<span v-if="displayFormLogin">
|
|
14
|
+
<div class="page-login-field half-top">
|
|
15
|
+
<i style="padding-top: 15px">
|
|
16
|
+
<img src="https://cdn.tapni.co/icons/user.png" class="responsive-image" style="width: 50%" />
|
|
17
|
+
</i>
|
|
18
|
+
<input v-model="emailOrUsername" @keydown.space.prevent autocorrect="off" autocapitalize="off" spellcheck="false" type="text" name="email" :placeholder="ssoLang[this.appLanguage].email_username" required />
|
|
19
|
+
<em></em>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="page-login-field half-bottom">
|
|
22
|
+
<i style="padding-top: 15px">
|
|
23
|
+
<img src="https://cdn.tapni.co/icons/padlock.png" class="responsive-image" style="width: 50%" />
|
|
24
|
+
</i>
|
|
25
|
+
<input v-model="password" :type="revealPassword ? 'text' : 'password'" :placeholder="ssoLang[this.appLanguage].password" name="password" required minlength="8" />
|
|
26
|
+
<em @click="revealPassword = !revealPassword" class="pointer">
|
|
27
|
+
<img v-show="!revealPassword" src="https://cdn.tapni.co/icons/reveal-password.png" class="responsive-image password-reveal-icon" />
|
|
28
|
+
<img v-show="revealPassword" src="https://cdn.tapni.co/icons/hide-password.png" class="responsive-image password-reveal-icon" />
|
|
29
|
+
</em>
|
|
30
|
+
</div>
|
|
31
|
+
<button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
|
|
32
|
+
<span v-if="!submitted">{{ ssoLang[appLanguage].login }}</span>
|
|
33
|
+
<span v-else class="button--loading button__loader"></span>
|
|
34
|
+
</button>
|
|
35
|
+
</span>
|
|
36
|
+
<div class="decoration decoration-lines-thin half-top half-bottom"></div>
|
|
37
|
+
<!-- Apple Login Button -->
|
|
38
|
+
<a @click="appleLogin" v-if="displayAppleLogin" class="button-center button button-90 google-button pointer">
|
|
39
|
+
<img src="https://cdn.tapni.co/icons/apple-logo.png" style="position: absolute; margin-left: -11px; padding: 8px 0; height: 100%" />
|
|
40
|
+
<span v-if="!appleLoad">{{ ssoLang[appLanguage].sign_in_with }} Apple</span>
|
|
41
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
42
|
+
</a>
|
|
43
|
+
|
|
44
|
+
<!-- Google Login Button -->
|
|
45
|
+
<a @click="googleLogin" v-if="displayGoogleLogin" class="button-center button button-90 google-button pointer">
|
|
46
|
+
<img src="https://cdn.tapni.co/icons/g-logo.png" style="position: absolute; margin-left: -10px; padding: 8px 0; height: 100%" />
|
|
47
|
+
<span v-if="!googleLoad">{{ ssoLang[appLanguage].sign_in_with }} Google</span>
|
|
48
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
49
|
+
</a>
|
|
50
|
+
|
|
51
|
+
<!-- Facebook Login Button -->
|
|
52
|
+
<a @click="facebookLogin" v-if="displayFacebookLogin" class="button-center button button-90 google-button pointer">
|
|
53
|
+
<img src="https://cdn.tapni.co/icons/facebook-blue.png" style="position: absolute; margin-left: -9px; padding: 10px 0; height: 100%" />
|
|
54
|
+
<span v-if="!facebookLoad">{{ ssoLang[appLanguage].sign_in_with }} Facebook</span>
|
|
55
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
<!-- Microsoft Login Button -->
|
|
59
|
+
<a @click="microsoftLogin" v-if="!displayMicrosoftSSOLogin" class="button-center button button-90 google-button pointer">
|
|
60
|
+
<img src="https://cdn.tapni.co/icons/outlook.png" style="position: absolute; margin-left: -8px; padding: 10px 0; height: 100%" />
|
|
61
|
+
<span v-if="!microsoftLoad">{{ ssoLang[appLanguage].sign_in_with }} Outlook</span>
|
|
62
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
63
|
+
</a>
|
|
64
|
+
|
|
65
|
+
<!-- Microsoft SSO Button -->
|
|
66
|
+
<a @click="ssoLogin" v-if="!displayMicrosoftSSOLogin" class="button-center button button-90 google-button pointer">
|
|
67
|
+
<img src="https://cdn.tapni.co/icons/sso-key.png" style="position: absolute; margin-left: -8px; padding: 10px 0; height: 100%" />
|
|
68
|
+
<span v-if="!microsoftSSOLoad">{{ ssoLang[appLanguage].sign_in_with }} SSO</span>
|
|
69
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
70
|
+
</a>
|
|
71
|
+
<!-- Microsoft SSO Button -->
|
|
72
|
+
<a @click="microsoftLogin('sso')" v-if="displayMicrosoftSSOLogin" class="button-center button button-90 google-button pointer">
|
|
73
|
+
<img src="https://cdn.tapni.co/icons/sso-key.png" style="position: absolute; margin-left: -8px; padding: 10px 0; height: 100%" />
|
|
74
|
+
<span v-if="microsoftSSOLoad">{{ ssoLang[appLanguage].sign_in_with }} SSO</span>
|
|
75
|
+
<span v-else class="button--loading-black button__loader"></span>
|
|
76
|
+
</a>
|
|
77
|
+
|
|
78
|
+
<!-- Email Login Button -->
|
|
79
|
+
<a @click="emailLogin = true" v-if="!displayFormLogin" class="button-center button button-90 google-button pointer">
|
|
80
|
+
<img src="https://cdn.tapni.co/icons/mail.png" style="position: absolute; margin-left: -8px; padding: 12px 0; height: 100%" />
|
|
81
|
+
<span>{{ ssoLang[appLanguage].sign_in_with }} Email</span>
|
|
82
|
+
</a>
|
|
83
|
+
|
|
84
|
+
<!-- Google Login Button -->
|
|
85
|
+
<a @click="$router.push('/qr')" v-if="displayQRLogin" class="button-center button button-90 google-button pointer">
|
|
86
|
+
<img src="https://cdn.tapni.co/icons/qr.png" style="position: absolute; margin-left: -5px; padding: 15px 0; height: 100%" />
|
|
87
|
+
<span>{{ ssoLang[appLanguage].sign_in_with }} QR</span>
|
|
88
|
+
</a>
|
|
89
|
+
|
|
90
|
+
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
91
|
+
|
|
92
|
+
<p class="close-text center-text half-top color-black">
|
|
93
|
+
{{ ssoLang[appLanguage].terms_by_signing_in }} <br />
|
|
94
|
+
<a class="" href="https://tapni.com/policies/terms-of-service">{{ ssoLang[this.appLanguage].terms_of_service }}</a>
|
|
95
|
+
{{ ssoLang[appLanguage].and }}
|
|
96
|
+
<a href="https://tapni.com/policies/privacy-policy">{{ ssoLang[this.appLanguage].privacy_policy }}</a>
|
|
97
|
+
</p>
|
|
98
|
+
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
99
|
+
<div v-if="!isModal" class="page-login-links">
|
|
100
|
+
<router-link v-if="displayRegisterLogin" class="forgot float-right" to="/register">{{ ssoLang[appLanguage].create_account }}</router-link>
|
|
101
|
+
<router-link v-if="displayResetPasswordLogin" class="create float-left" to="/reset">{{ ssoLang[appLanguage].reset_password }}</router-link>
|
|
102
|
+
<div class="clear"></div>
|
|
103
|
+
</div>
|
|
104
|
+
<div v-else class="page-login-links" @click="createAccountModal">
|
|
105
|
+
<a class="forgot center-text pointer small-top"
|
|
106
|
+
>{{ ssoLang[appLanguage].or }} <br />
|
|
107
|
+
{{ ssoLang[appLanguage].create_new_account }}</a
|
|
108
|
+
>
|
|
109
|
+
<div class="clear"></div>
|
|
110
|
+
</div>
|
|
111
|
+
</form>
|
|
283
112
|
</template>
|
|
284
113
|
|
|
285
114
|
<script>
|
|
286
|
-
import GoogleMixin from
|
|
287
|
-
import FacebookMixin from
|
|
288
|
-
import AppleMixin from
|
|
289
|
-
import MicrosoftMixin from
|
|
290
|
-
import OktaMixin from
|
|
291
|
-
import SamlMixin from
|
|
292
|
-
import AuthMixin from
|
|
293
|
-
import MFAMixin from
|
|
294
|
-
import QRAuthMixin from
|
|
295
|
-
import { EventBus } from
|
|
296
|
-
import to from
|
|
115
|
+
import GoogleMixin from '../mixins/google.mixin';
|
|
116
|
+
import FacebookMixin from '../mixins/facebook.mixin';
|
|
117
|
+
import AppleMixin from '../mixins/apple.mixin';
|
|
118
|
+
import MicrosoftMixin from '../mixins/microsoft.mixin';
|
|
119
|
+
import OktaMixin from '../mixins/okta.mixin';
|
|
120
|
+
import SamlMixin from '../mixins/saml.mixin';
|
|
121
|
+
import AuthMixin from '../mixins/auth.mixin';
|
|
122
|
+
import MFAMixin from '../mixins/mfa-auth.mixin';
|
|
123
|
+
import QRAuthMixin from '../mixins/qr-auth.mixin';
|
|
124
|
+
import { EventBus } from '../store/event-bus';
|
|
125
|
+
import to from 'await-to-js';
|
|
297
126
|
export default {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
},
|
|
127
|
+
name: 'AuthLogin',
|
|
128
|
+
mixins: [GoogleMixin, FacebookMixin, AppleMixin, MicrosoftMixin, OktaMixin, SamlMixin, AuthMixin, QRAuthMixin, MFAMixin],
|
|
129
|
+
props: {
|
|
130
|
+
isModal: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
required: false,
|
|
133
|
+
default: false
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
data() {
|
|
137
|
+
return {
|
|
138
|
+
loading: true,
|
|
139
|
+
submitted: false,
|
|
140
|
+
emailOrUsername: '',
|
|
141
|
+
password: '',
|
|
142
|
+
captcha: '',
|
|
143
|
+
revealPassword: false,
|
|
144
|
+
emailLogin: true
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
computed: {
|
|
148
|
+
displayFormLogin() {
|
|
149
|
+
return this.emailLogin;
|
|
150
|
+
},
|
|
151
|
+
displayResetPasswordLogin() {
|
|
152
|
+
return true;
|
|
153
|
+
},
|
|
154
|
+
displayRegisterLogin() {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
async mounted() {
|
|
159
|
+
if (!this.isModal) {
|
|
160
|
+
if (this.$route.path === '/login/callback/okta') return await this.handleOktaRedirect();
|
|
161
|
+
if (this.$route.path === '/login/callback/saml') return await this.handleSamlRedirect();
|
|
162
|
+
if (this.$route.query.qrLogin) this.changeLoginToQr();
|
|
163
|
+
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
if (this.$storex && this.$storex.token) {
|
|
166
|
+
if (import.meta.env.VITE_APP_MODE === 'npm') this.$router.push(this.home);
|
|
167
|
+
else if (import.meta.env.VITE_APP_MODE === 'redirect') location.href = this.home;
|
|
168
|
+
} else {
|
|
169
|
+
EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
|
|
170
|
+
}
|
|
171
|
+
}, 2500);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
methods: {
|
|
175
|
+
async submit() {
|
|
176
|
+
// if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
|
|
177
|
+
if (this.submitted) return;
|
|
178
|
+
this.submitted = true;
|
|
179
|
+
|
|
180
|
+
this.emailOrUsername = this.emailOrUsername.trim();
|
|
181
|
+
|
|
182
|
+
let response_type = this.$route.query.response_type;
|
|
183
|
+
|
|
184
|
+
let loginData = {
|
|
185
|
+
response_type: response_type || 'token',
|
|
186
|
+
isModal: this.isModal,
|
|
187
|
+
captcha: this.captcha,
|
|
188
|
+
password: this.password,
|
|
189
|
+
otpToken: this.otpToken
|
|
190
|
+
// captchaToken: await this.getCaptchaToken('account_verify')
|
|
191
|
+
};
|
|
192
|
+
if (this.emailOrUsername.indexOf('@') !== -1) {
|
|
193
|
+
loginData.email = this.emailOrUsername;
|
|
194
|
+
} else {
|
|
195
|
+
loginData.username = this.emailOrUsername;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const [err, result] = await to(this.login(loginData));
|
|
199
|
+
if (err) console.error(err);
|
|
200
|
+
|
|
201
|
+
this.submitted = false;
|
|
202
|
+
|
|
203
|
+
if (result === true) {
|
|
204
|
+
this.emailOrUsername = '';
|
|
205
|
+
this.password = '';
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
close() {
|
|
209
|
+
EventBus.$emit('ssoEvent', { name: 'toggleAuthModal', data: true });
|
|
210
|
+
},
|
|
211
|
+
createAccountModal() {
|
|
212
|
+
EventBus.$emit('ssoEvent', { name: 'toggleAddAccountModalRegister', data: {} });
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
watch: {
|
|
216
|
+
emailOrUsername(nv) {
|
|
217
|
+
if (nv.includes('@')) {
|
|
218
|
+
this.$storex.verifyEmail = nv;
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
'$route.path': async function (routePath) {
|
|
222
|
+
if (routePath === '/login/callback/okta') return await this.handleOktaRedirect();
|
|
223
|
+
if (routePath === '/login/callback/saml') return await this.handleSamlRedirect();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
398
226
|
};
|
|
399
227
|
</script>
|
|
400
228
|
|