@tapni/auth 1.0.7 → 1.0.9

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.
Files changed (54) hide show
  1. package/README.md +2 -0
  2. package/dist/.vite/manifest.json +12 -19
  3. package/dist/.well-known/assetlinks.json +10 -12
  4. package/dist/.well-known/microsoft-identity-association.json +5 -5
  5. package/dist/{Apps-BNLnNAmv.js → Apps-spt3-xmr.js} +1 -1
  6. package/dist/{Billing-C6F6zxbg.js → Billing-EQtSRyls.js} +1 -1
  7. package/dist/{CustomApp-B78nPESB.js → CustomApp-DytcodWc.js} +1 -1
  8. package/dist/{General-E-VRkj_Y.js → General-BBoC_TV2.js} +1 -1
  9. package/dist/{QR-vXam_Tu3.js → QR-DmSyXgb5.js} +1 -1
  10. package/dist/TapniAuth.es.js +1 -1
  11. package/dist/TapniAuth.umd.js +15 -15
  12. package/dist/blank.html +31 -0
  13. package/dist/{install-DW5mvDvp.js → install-DJ7V1wyP.js} +1870 -1940
  14. package/dist/site.webmanifest +11 -1
  15. package/dist/style.css +1 -1
  16. package/package.json +14 -5
  17. package/src/.prettierrc.json +16 -0
  18. package/src/components/DELETE_LinkIcon.vue +174 -225
  19. package/src/components/DELETE_SSOPick.vue +93 -148
  20. package/src/eslint.config.js +15 -0
  21. package/src/install.js +9 -10
  22. package/src/main.js +54 -57
  23. package/src/mixins/apple.mixin.js +56 -54
  24. package/src/mixins/auth.mixin.js +3 -2
  25. package/src/mixins/global.mixin.js +2 -2
  26. package/src/mixins/google.mixin.js +53 -54
  27. package/src/mixins/qr-auth.mixin.js +111 -107
  28. package/src/router/index.js +6 -6
  29. package/src/routes.js +1 -1
  30. package/src/services/Api.js +55 -57
  31. package/src/services/AuthService.js +0 -8
  32. package/src/services/CompanyService.js +10 -10
  33. package/src/services/DeviceService.js +3 -3
  34. package/src/services/UserService.js +45 -45
  35. package/src/services/UtilService.js +256 -218
  36. package/src/store/event-bus.js +22 -22
  37. package/src/store/locales/cn.js +442 -458
  38. package/src/store/locales/de.js +438 -517
  39. package/src/store/locales/es.js +442 -524
  40. package/src/store/locales/fr.js +442 -516
  41. package/src/store/locales/it.js +442 -514
  42. package/src/store/locales/kr.js +442 -491
  43. package/src/store/locales/lang.js +43 -43
  44. package/src/store/locales/sr.js +439 -492
  45. package/src/store/locales/tr.js +436 -487
  46. package/src/store/store.js +6 -6
  47. package/src/views/Account.vue +2 -2
  48. package/src/views/Callback.vue +36 -33
  49. package/src/views/Login.vue +4 -26
  50. package/src/views/Register.vue +1 -11
  51. package/src/views/Reset.vue +132 -135
  52. package/src/views/Verify.vue +153 -151
  53. package/dist/web-AXRKjAOB.js +0 -92
  54. package/src/mixins/facebook.mixin.js +0 -78
@@ -1,170 +1,172 @@
1
1
  <template>
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>
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
- <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>
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
- <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">{{ssoLang[this.appLanguage].or}} <br> {{ssoLang[this.appLanguage].create_new_account}}</a>
43
- <div class="clear"></div>
44
- </div>
45
- </form>
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 "../store/event-bus";
50
- import AuthMixin from "../mixins/auth.mixin";
52
+ import { EventBus } from '../store/event-bus';
53
+ import AuthMixin from '../mixins/auth.mixin';
51
54
  export default {
52
- name: 'AuthVerify',
53
- mixins: [AuthMixin],
54
- props: {
55
- isModal: {
56
- type: Boolean,
57
- required: false,
58
- default: false
59
- },
60
- },
61
- data () {
62
- return {
63
- loading: true,
64
- submitted: false,
65
- action: 'verify',
66
- email: '',
67
- code: '',
68
- captcha: ''
69
- }
70
- },
71
- mounted () {
72
- if (this.$storex.verifyEmail) this.email = this.$storex.verifyEmail
73
- if (this.$route) this.init()
74
- },
75
- methods: {
76
- init() {
77
- if (this.isLoggedIn) {
78
- this.$router.push(this.home)
79
- } else {
80
- if (this.$storex.verifyEmail) {
81
- this.email = this.$storex.verifyEmail
82
- }
83
- if (this.$route.hash === '#reset') {
84
- this.action = 'reset'
85
- }
86
- if (this.$route.query.e) {
87
- this.email = this.$route.query.e
88
- }
89
- if (this.$route.query.c) {
90
- this.code = this.$route.query.c
91
- }
92
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
93
- }
94
- },
95
- async submit() {
96
- // if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
97
- if (this.code.length !== 6) {
98
- return this.errorSnack(this.ssoLang[this.appLanguage].invalid_code);
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
- let data = {
105
- code: this.code,
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
- if(this.submitted) return false;
111
- this.submitted = true
107
+ let data = {
108
+ code: this.code,
109
+ email: this.email,
110
+ captchaToken: await this.getCaptchaToken('account_verify')
111
+ };
112
112
 
113
- let response = await this.verify(data);
114
- this.submitted = false
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
- registerAccountModal () {
136
- EventBus.$emit('ssoEvent', {name: 'toggleAddAccountModalRegister', data: false})
137
- },
138
- close () {
139
- EventBus.$emit('ssoEvent', {name: 'toggleAddAccountModal', data: true})
140
- },
141
- },
142
- watch: {
143
- '$storage.verifyEmail' (nv) {
144
- if (nv) this.email = nv
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
- 'route.name' (nv, ov) {
147
- if (!ov && nv) this.init()
148
- },
149
- 'route.query': {
150
- handler(nv) {
151
- if (!this.isEmpty(nv)) this.init()
152
- },
153
- deep: true,
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
- #codeInput {
161
- text-align: center;
162
- padding-right: 15%;
163
- font-size: 17px;
164
- }
165
- #emailInput {
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>
@@ -1,92 +0,0 @@
1
- import { WebPlugin as i } from "@capacitor/core";
2
- class u extends i {
3
- async initialize(e) {
4
- const n = { version: "v17.0" };
5
- return await this.loadScript(e.locale), FB.init(Object.assign(Object.assign({}, n), e));
6
- }
7
- loadScript(e) {
8
- if (typeof document > "u")
9
- return Promise.reject("document global not found");
10
- const n = "fb";
11
- if (document.getElementById(n))
12
- return Promise.resolve();
13
- const r = document.getElementsByTagName("head")[0], s = document.createElement("script");
14
- return new Promise((o) => {
15
- s.onload = () => o(), s.defer = !0, s.async = !0, s.id = n, s.src = `https://connect.facebook.net/${e ?? "en_US"}/sdk.js`, r.appendChild(s);
16
- });
17
- }
18
- async login(e) {
19
- return new Promise((n, t) => {
20
- FB.login((r) => {
21
- r.status === "connected" ? n({
22
- accessToken: {
23
- token: r.authResponse.accessToken
24
- }
25
- }) : t({
26
- accessToken: {
27
- token: null
28
- }
29
- });
30
- }, { scope: e.permissions.join(",") });
31
- });
32
- }
33
- async logout() {
34
- return new Promise((e) => FB.logout(() => e()));
35
- }
36
- async reauthorize() {
37
- return new Promise((e) => FB.reauthorize((n) => e(n)));
38
- }
39
- async getCurrentAccessToken() {
40
- return new Promise((e, n) => {
41
- FB.getLoginStatus((t) => {
42
- if (t.status === "connected") {
43
- const r = {
44
- accessToken: {
45
- applicationId: void 0,
46
- declinedPermissions: [],
47
- expires: void 0,
48
- isExpired: void 0,
49
- lastRefresh: void 0,
50
- permissions: [],
51
- token: t.authResponse.accessToken,
52
- userId: t.authResponse.userID
53
- }
54
- };
55
- e(r);
56
- } else
57
- n({
58
- accessToken: {
59
- token: null
60
- }
61
- });
62
- });
63
- });
64
- }
65
- async getProfile(e) {
66
- const n = e.fields.join(",");
67
- return new Promise((t, r) => {
68
- FB.api("/me", { fields: n }, (s) => {
69
- if (s.error) {
70
- r(s.error.message);
71
- return;
72
- }
73
- t(s);
74
- });
75
- });
76
- }
77
- async logEvent() {
78
- return Promise.resolve();
79
- }
80
- async setAutoLogAppEventsEnabled() {
81
- return Promise.resolve();
82
- }
83
- async setAdvertiserTrackingEnabled() {
84
- return Promise.resolve();
85
- }
86
- async setAdvertiserIDCollectionEnabled() {
87
- return Promise.resolve();
88
- }
89
- }
90
- export {
91
- u as FacebookLoginWeb
92
- };
@@ -1,78 +0,0 @@
1
- import to from 'await-to-js'
2
- import AuthService from '../services/AuthService'
3
- import { FacebookLogin } from '@capacitor-community/facebook-login';
4
- import {EventBus} from "../store/event-bus";
5
-
6
- window.fbAsyncInit = function () {
7
- // eslint-disable-next-line no-undef
8
- FB.init({
9
- appId: '202577611527680',
10
- cookie: true, // enable cookies to allow the server to access the session
11
- xfbml: true, // parse social plugins on this page
12
- version: 'v16.0' // use graph api current version
13
- })
14
- };
15
-
16
- // Load the SDK asynchronously
17
- (function (d, s, id) {
18
- // eslint-disable-next-line one-var
19
- var js, fjs = d.getElementsByTagName(s)[0]
20
- if (d.getElementById(id)) return
21
- js = d.createElement(s); js.id = id
22
- js.src = 'https://connect.facebook.net/en_US/sdk.js'
23
- fjs.parentNode.insertBefore(js, fjs)
24
- }(document, 'script', 'facebook-jssdk'))
25
-
26
- export default {
27
- data () {
28
- return {
29
- facebookLoad: false
30
- }
31
- },
32
- computed: {
33
- fbLoginUrl () {
34
- return 'https://www.facebook.com/v16.0/dialog/oauth?client_id=202577611527680&state={"oauth":"facebook"}&response_type=code%20granted_scopes&scope=email&redirect_uri=https://' + window.location.host + '/login'
35
- },
36
- displayFacebookLogin () {
37
- return false;
38
- }
39
- },
40
- methods: {
41
- async facebookLogin () {
42
- this.facebookLoad = true
43
- const FACEBOOK_PERMISSIONS = ['email']
44
- const [errAuth, user] = await to(FacebookLogin.login({permissions: FACEBOOK_PERMISSIONS}))
45
- if (errAuth) return this.facebookLoad = false
46
-
47
- // Track Referrals
48
- if (this.referral) user.ref = this.referral;
49
-
50
- if (this.display === 'popup') user.response_type = 'code';
51
-
52
- if (user && user.accessToken) {
53
-
54
- const [err, response] = await to(AuthService.facebookSDK(user, this.$storex))
55
- if (err) {
56
- this.facebookLoad = false
57
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
58
- return this.errorHandler(err)
59
- }
60
- if (response.data.success) {
61
- if (this.display === 'popup') {
62
- return window.parent?.postMessage({ code: response.data.auth_code, state: this.$route.query.state }, '*');
63
- }
64
- await this.loginSetup(response)
65
- await this.getLoggedInAccounts()
66
- this.$router.push('/' + response.data.data.username + '#edit')
67
- setTimeout(() => {
68
- this.facebookLoad = false
69
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
70
- }, 1000)
71
- } else this.errorSnack(this.ssoLang[this.appLanguage].unexpected_err)
72
- } else {
73
- this.facebookLoad = false
74
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
75
- }
76
- }
77
- }
78
- }