@tapni/auth 0.0.170 → 0.0.171
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-BB71UmF3.js} +31 -32
- package/dist/{QR-2Izy5Dj4.js → QR-BJnR_0ci.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-Cx9Gi17U.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/Reset.vue
CHANGED
|
@@ -1,155 +1,152 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</p>
|
|
20
|
-
<div class="decoration decoration-lines-thin no-bottom half-top"></div>
|
|
2
|
+
<form v-if="!passwordChange" class="page-login content-boxed content-boxed-padding" @submit.prevent="resetEmail" autocomplete="on">
|
|
3
|
+
<h3 class="bold no-bottom center-text" style="margin-top: 63px">{{ ssoLang[this.appLanguage].reset_password }}</h3>
|
|
4
|
+
<p class="half-bottom small-top center-text color-black"></p>
|
|
5
|
+
<div class="page-login-field half-top color-black">
|
|
6
|
+
<i style="padding-top: 10px; margin-left: 10px">
|
|
7
|
+
<img src="https://cdn.tapni.co/icons/mail.png" class="responsive-image" style="width: 80%" />
|
|
8
|
+
</i>
|
|
9
|
+
<input id="emailInput" v-model="email" @keydown.space.prevent type="email" :placeholder="ssoLang[this.appLanguage].email" required />
|
|
10
|
+
<em></em>
|
|
11
|
+
</div>
|
|
12
|
+
<button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
|
|
13
|
+
<span v-if="!submitted" class="uppercase">{{ ssoLang[this.appLanguage].reset_password }}</span>
|
|
14
|
+
<span v-else class="button--loading button__loader"></span>
|
|
15
|
+
</button>
|
|
16
|
+
<div class="decoration decoration-lines-thin no-bottom half-top"></div>
|
|
17
|
+
<p class="close-text center-text half-top color-black"><span v-html="ssoLang[this.appLanguage].reset_password_p1"></span><a :href="'mailto:support@tapni.com?subject=' + ssoLang[this.appLanguage].password_reset_t"> support@tapni.com</a></p>
|
|
18
|
+
<div class="decoration decoration-lines-thin no-bottom half-top"></div>
|
|
21
19
|
|
|
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
|
-
|
|
20
|
+
<div class="page-login-links">
|
|
21
|
+
<router-link class="create float-right" to="/verify">{{ ssoLang[this.appLanguage].verify_account }}</router-link>
|
|
22
|
+
<router-link class="forgot float-left" to="/login">{{ ssoLang[this.appLanguage].sign_in }}</router-link>
|
|
23
|
+
<div class="clear"></div>
|
|
24
|
+
</div>
|
|
25
|
+
</form>
|
|
26
|
+
<form v-else class="page-login content-boxed content-boxed-padding" @submit.prevent="changePw">
|
|
27
|
+
<h3 class="bold no-bottom center-text" style="margin-top: 63px">{{ ssoLang[this.appLanguage].password_change }}</h3>
|
|
28
|
+
<p class="half-bottom small-top center-text color-black">{{ ssoLang[this.appLanguage].password_new }}</p>
|
|
29
|
+
<div class="page-login-field half-top">
|
|
30
|
+
<i style="padding-top: 15px">
|
|
31
|
+
<img src="https://cdn.tapni.co/icons/padlock.png" class="responsive-image" style="width: 50%" />
|
|
32
|
+
</i>
|
|
33
|
+
<input v-model="password" :type="revealPassword ? 'text' : 'password'" :placeholder="ssoLang[this.appLanguage].password" required />
|
|
34
|
+
<em @click="revealPassword = !revealPassword">
|
|
35
|
+
<img v-show="!revealPassword" src="https://cdn.tapni.co/icons/reveal-password.png" class="responsive-image password-reveal-icon" />
|
|
36
|
+
<img v-show="revealPassword" src="https://cdn.tapni.co/icons/hide-password.png" class="responsive-image password-reveal-icon" />
|
|
37
|
+
</em>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="page-login-field half-top">
|
|
40
|
+
<i style="padding-top: 15px">
|
|
41
|
+
<img src="https://cdn.tapni.co/icons/padlock.png" class="responsive-image" style="width: 50%" />
|
|
42
|
+
</i>
|
|
43
|
+
<input v-model="passwordRepeat" :type="revealPassword2 ? 'text' : 'password'" :placeholder="ssoLang[this.appLanguage].password_repeat" required />
|
|
44
|
+
<em @click="revealPassword2 = !revealPassword2">
|
|
45
|
+
<img v-show="!revealPassword2" src="https://cdn.tapni.co/icons/reveal-password.png" class="responsive-image password-reveal-icon" />
|
|
46
|
+
<img v-show="revealPassword2" src="https://cdn.tapni.co/icons/hide-password.png" class="responsive-image password-reveal-icon" />
|
|
47
|
+
</em>
|
|
48
|
+
</div>
|
|
49
|
+
<button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
|
|
50
|
+
<span v-if="!submitted" class="uppercase">{{ ssoLang[this.appLanguage].password_change }}</span>
|
|
51
|
+
<span v-else class="button--loading button__loader"></span>
|
|
52
|
+
</button>
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</p>
|
|
60
|
-
</form>
|
|
54
|
+
<div class="decoration decoration-lines-thin no-bottom half-top"></div>
|
|
55
|
+
<p class="close-text center-text half-top color-black"><span v-html="ssoLang[this.appLanguage].reset_password_p2"></span> <a :href="'mailto:support@tapni.com?subject=' + ssoLang[this.appLanguage].password_reset_t"> support@tapni.com</a></p>
|
|
56
|
+
</form>
|
|
61
57
|
</template>
|
|
62
58
|
|
|
63
59
|
<script>
|
|
64
|
-
import AuthMixin from
|
|
65
|
-
import {EventBus} from
|
|
60
|
+
import AuthMixin from '../mixins/auth.mixin';
|
|
61
|
+
import { EventBus } from '../store/event-bus';
|
|
66
62
|
|
|
67
63
|
export default {
|
|
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
|
-
|
|
64
|
+
name: 'AuthReset',
|
|
65
|
+
mixins: [AuthMixin],
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
loading: true,
|
|
69
|
+
submitted: false,
|
|
70
|
+
passwordChange: false,
|
|
71
|
+
email: '',
|
|
72
|
+
password: '',
|
|
73
|
+
passwordRepeat: '',
|
|
74
|
+
code: '',
|
|
75
|
+
captcha: '',
|
|
76
|
+
revealPassword: false,
|
|
77
|
+
revealPassword2: false
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
mounted() {
|
|
81
|
+
if (this.$storex.verifyEmail) {
|
|
82
|
+
this.email = this.$storex.verifyEmail;
|
|
83
|
+
}
|
|
84
|
+
if (this.$route.query.c) {
|
|
85
|
+
this.code = this.$route.query.c;
|
|
86
|
+
this.passwordChange = true;
|
|
87
|
+
}
|
|
88
|
+
if (this.$route.query.e) {
|
|
89
|
+
this.email = this.$route.query.e;
|
|
90
|
+
}
|
|
91
|
+
EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
async resetEmail() {
|
|
95
|
+
// if (this.captcha === '') return this.errorHandler({ message: 'Please select recaptcha' });
|
|
100
96
|
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
if (this.submitted) return;
|
|
98
|
+
this.submitted = true;
|
|
103
99
|
|
|
104
|
-
|
|
100
|
+
this.email = this.email.trim();
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
let data = {
|
|
103
|
+
email: this.email,
|
|
104
|
+
captchaToken: await this.getCaptchaToken('password_reset')
|
|
105
|
+
};
|
|
110
106
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
await this.reset(data);
|
|
108
|
+
this.submitted = false;
|
|
109
|
+
await this.$router.push('/verify?e=' + this.email + '#reset');
|
|
110
|
+
},
|
|
111
|
+
async changePw() {
|
|
112
|
+
// if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
|
|
113
|
+
if (this.code.length !== 6) return this.errorSnack(this.ssoLang[this.appLanguage].invalid_code);
|
|
114
|
+
if (this.password !== this.passwordRepeat) return this.errorSnack(this.ssoLang[this.appLanguage].password_not_match);
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
|
|
118
|
-
if (this.code.length !== 6) return this.errorSnack(this.ssoLang[this.appLanguage].invalid_code);
|
|
119
|
-
if (this.password !== this.passwordRepeat) return this.errorSnack(this.ssoLang[this.appLanguage].password_not_match);
|
|
116
|
+
if (this.submitted) return;
|
|
117
|
+
this.submitted = true;
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
this.email = this.email.trim();
|
|
120
|
+
this.code = this.code.trim();
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
let data = {
|
|
123
|
+
email: this.email,
|
|
124
|
+
code: this.code,
|
|
125
|
+
password: this.password,
|
|
126
|
+
passwordRepeat: this.passwordRepeat,
|
|
127
|
+
captchaToken: await this.getCaptchaToken('password_reset')
|
|
128
|
+
};
|
|
126
129
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
watch: {
|
|
144
|
-
email(nv) { this.$storex.verifyEmail = nv }
|
|
145
|
-
}
|
|
146
|
-
}
|
|
130
|
+
let success = await this.changePassword(data);
|
|
131
|
+
this.submitted = false;
|
|
132
|
+
if (success === true) {
|
|
133
|
+
this.$router.push('/login');
|
|
134
|
+
this.successSnack(this.ssoLang[this.appLanguage].password_reseted_success);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
watch: {
|
|
139
|
+
email(nv) {
|
|
140
|
+
this.$storex.verifyEmail = nv;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
147
144
|
</script>
|
|
148
145
|
|
|
149
146
|
<style scoped>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
#emailInput {
|
|
148
|
+
text-align: center;
|
|
149
|
+
padding-right: 15%;
|
|
150
|
+
font-size: 17px;
|
|
151
|
+
}
|
|
155
152
|
</style>
|
package/src/views/Verify.vue
CHANGED
|
@@ -1,170 +1,172 @@
|
|
|
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
|
-
|
|
2
|
+
<form class="page-login content-boxed content-boxed-padding" @submit.prevent="submit" :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">{{ ssoLang[this.appLanguage].verify_account }}</h1>
|
|
9
|
+
<p class="half-bottom half-top center-text color-black"></p>
|
|
10
|
+
<div class="page-login-field half-top">
|
|
11
|
+
<i style="padding-top: 15px; margin-left: 10px">
|
|
12
|
+
<img src="https://cdn.tapni.co/icons/mail.png" class="responsive-image" style="width: 80%" />
|
|
13
|
+
</i>
|
|
14
|
+
<input id="emailInput" v-model="email" @keydown.space.prevent type="email" :placeholder="ssoLang[this.appLanguage].email" required />
|
|
15
|
+
<em></em>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="page-login-field half-top">
|
|
18
|
+
<i style="padding-top: 15px; margin-left: 10px">
|
|
19
|
+
<img src="https://cdn.tapni.co/icons/password2.png" class="responsive-image" style="width: 100%" />
|
|
20
|
+
</i>
|
|
21
|
+
<input id="codeInput" v-model="code" @keydown.space.prevent type="tel" :placeholder="ssoLang[this.appLanguage].code" required />
|
|
22
|
+
<em></em>
|
|
23
|
+
</div>
|
|
24
|
+
<button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
|
|
25
|
+
<span v-if="!submitted" class="uppercase">{{ ssoLang[this.appLanguage].verify_account }}</span>
|
|
26
|
+
<span v-else class="button--loading button__loader"></span>
|
|
27
|
+
</button>
|
|
28
|
+
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<p class="close-text center-text half-top color-black">
|
|
31
|
+
<span v-html="ssoLang[this.appLanguage].verify_account_p1"></span>
|
|
32
|
+
<a href="mailto:support@tapni.com?subject=Email Verification"> support@tapni.com</a>
|
|
33
|
+
</p>
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
<div class="decoration decoration-lines-thin no-bottom"></div>
|
|
36
|
+
<div v-if="!isModal" class="page-login-links">
|
|
37
|
+
<router-link class="create float-right" to="/register">{{ ssoLang[this.appLanguage].register }}</router-link>
|
|
38
|
+
<router-link class="forgot float-left" to="/login">{{ ssoLang[this.appLanguage].sign_in }}</router-link>
|
|
39
|
+
<div class="clear"></div>
|
|
40
|
+
</div>
|
|
41
|
+
<div v-else class="page-login-links" @click="registerAccountModal">
|
|
42
|
+
<a class="forgot center-text pointer small-top"
|
|
43
|
+
>{{ ssoLang[this.appLanguage].or }} <br />
|
|
44
|
+
{{ ssoLang[this.appLanguage].create_new_account }}</a
|
|
45
|
+
>
|
|
46
|
+
<div class="clear"></div>
|
|
47
|
+
</div>
|
|
48
|
+
</form>
|
|
46
49
|
</template>
|
|
47
50
|
|
|
48
51
|
<script>
|
|
49
|
-
import {EventBus} from
|
|
50
|
-
import AuthMixin from
|
|
52
|
+
import { EventBus } from '../store/event-bus';
|
|
53
|
+
import AuthMixin from '../mixins/auth.mixin';
|
|
51
54
|
export default {
|
|
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
|
-
this.email = this.email.trim()
|
|
102
|
-
this.code = this.code.trim()
|
|
55
|
+
name: 'AuthVerify',
|
|
56
|
+
mixins: [AuthMixin],
|
|
57
|
+
props: {
|
|
58
|
+
isModal: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
required: false,
|
|
61
|
+
default: false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
loading: true,
|
|
67
|
+
submitted: false,
|
|
68
|
+
action: 'verify',
|
|
69
|
+
email: '',
|
|
70
|
+
code: '',
|
|
71
|
+
captcha: ''
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
mounted() {
|
|
75
|
+
if (this.$storex.verifyEmail) this.email = this.$storex.verifyEmail;
|
|
76
|
+
if (this.$route) this.init();
|
|
77
|
+
},
|
|
78
|
+
methods: {
|
|
79
|
+
init() {
|
|
80
|
+
if (this.isLoggedIn) {
|
|
81
|
+
this.$router.push(this.home);
|
|
82
|
+
} else {
|
|
83
|
+
if (this.$storex.verifyEmail) {
|
|
84
|
+
this.email = this.$storex.verifyEmail;
|
|
85
|
+
}
|
|
86
|
+
if (this.$route.hash === '#reset') {
|
|
87
|
+
this.action = 'reset';
|
|
88
|
+
}
|
|
89
|
+
if (this.$route.query.e) {
|
|
90
|
+
this.email = this.$route.query.e;
|
|
91
|
+
}
|
|
92
|
+
if (this.$route.query.c) {
|
|
93
|
+
this.code = this.$route.query.c;
|
|
94
|
+
}
|
|
95
|
+
EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
async submit() {
|
|
99
|
+
// if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
|
|
100
|
+
if (this.code.length !== 6) {
|
|
101
|
+
return this.errorSnack(this.ssoLang[this.appLanguage].invalid_code);
|
|
102
|
+
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
email: this.email,
|
|
107
|
-
captchaToken: await this.getCaptchaToken('account_verify')
|
|
108
|
-
}
|
|
104
|
+
this.email = this.email.trim();
|
|
105
|
+
this.code = this.code.trim();
|
|
109
106
|
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
let data = {
|
|
108
|
+
code: this.code,
|
|
109
|
+
email: this.email,
|
|
110
|
+
captchaToken: await this.getCaptchaToken('account_verify')
|
|
111
|
+
};
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (response && response.data && response.data.success === true) {
|
|
116
|
-
if (this.action === 'reset') {
|
|
117
|
-
this.$router.push('/reset?c=' + this.code + '&e=' + this.email)
|
|
118
|
-
this.successSnack(this.ssoLang[this.appLanguage].verify_account_success)
|
|
119
|
-
}
|
|
120
|
-
if (this.action === 'verify') {
|
|
121
|
-
if (this.isModal) {
|
|
122
|
-
this.email = ''
|
|
123
|
-
this.code = ''
|
|
124
|
-
EventBus.$emit('closeModal')
|
|
125
|
-
}
|
|
126
|
-
await this.loginSetup(response)
|
|
127
|
-
await this.getLoggedInAccounts()
|
|
128
|
-
this.$storex.verifyEmail = '';
|
|
129
|
-
this.$router.push('/' + response.data.data.username + '#edit')
|
|
130
|
-
this.successSnack(this.ssoLang[this.appLanguage].verify_account_success2)
|
|
131
|
-
}
|
|
132
|
-
} else this.submitted = false
|
|
113
|
+
if (this.submitted) return false;
|
|
114
|
+
this.submitted = true;
|
|
133
115
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
116
|
+
let response = await this.verify(data);
|
|
117
|
+
this.submitted = false;
|
|
118
|
+
if (response && response.data && response.data.success === true) {
|
|
119
|
+
if (this.action === 'reset') {
|
|
120
|
+
this.$router.push('/reset?c=' + this.code + '&e=' + this.email);
|
|
121
|
+
this.successSnack(this.ssoLang[this.appLanguage].verify_account_success);
|
|
122
|
+
}
|
|
123
|
+
if (this.action === 'verify') {
|
|
124
|
+
if (this.isModal) {
|
|
125
|
+
this.email = '';
|
|
126
|
+
this.code = '';
|
|
127
|
+
EventBus.$emit('closeModal');
|
|
128
|
+
}
|
|
129
|
+
await this.loginSetup(response);
|
|
130
|
+
await this.getLoggedInAccounts();
|
|
131
|
+
this.$storex.verifyEmail = '';
|
|
132
|
+
this.$router.push('/' + response.data.data.username + '#edit');
|
|
133
|
+
this.successSnack(this.ssoLang[this.appLanguage].verify_account_success2);
|
|
134
|
+
}
|
|
135
|
+
} else this.submitted = false;
|
|
136
|
+
},
|
|
137
|
+
registerAccountModal() {
|
|
138
|
+
EventBus.$emit('ssoEvent', { name: 'toggleAddAccountModalRegister', data: false });
|
|
139
|
+
},
|
|
140
|
+
close() {
|
|
141
|
+
EventBus.$emit('ssoEvent', { name: 'toggleAddAccountModal', data: true });
|
|
142
|
+
}
|
|
145
143
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
144
|
+
watch: {
|
|
145
|
+
'$storage.verifyEmail'(nv) {
|
|
146
|
+
if (nv) this.email = nv;
|
|
147
|
+
},
|
|
148
|
+
'route.name'(nv, ov) {
|
|
149
|
+
if (!ov && nv) this.init();
|
|
150
|
+
},
|
|
151
|
+
'route.query': {
|
|
152
|
+
handler(nv) {
|
|
153
|
+
if (!this.isEmpty(nv)) this.init();
|
|
154
|
+
},
|
|
155
|
+
deep: true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
157
159
|
</script>
|
|
158
160
|
|
|
159
161
|
<style scoped>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
#codeInput {
|
|
163
|
+
text-align: center;
|
|
164
|
+
padding-right: 15%;
|
|
165
|
+
font-size: 17px;
|
|
166
|
+
}
|
|
167
|
+
#emailInput {
|
|
166
168
|
text-align: center;
|
|
167
169
|
padding-right: 15%;
|
|
168
170
|
font-size: 17px;
|
|
169
|
-
|
|
171
|
+
}
|
|
170
172
|
</style>
|