@tapni/auth 1.0.8 → 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.
- package/README.md +2 -0
- package/dist/.vite/manifest.json +12 -12
- package/dist/.well-known/assetlinks.json +10 -12
- package/dist/.well-known/microsoft-identity-association.json +5 -5
- package/dist/{Apps-aanvwc1E.js → Apps-spt3-xmr.js} +1 -1
- package/dist/{Billing-C7LjeXBV.js → Billing-EQtSRyls.js} +1 -1
- package/dist/{CustomApp-Cd00FwXJ.js → CustomApp-DytcodWc.js} +1 -1
- package/dist/{General-DH-AnLIA.js → General-BBoC_TV2.js} +1 -1
- package/dist/{QR-cfWsMTIZ.js → QR-DmSyXgb5.js} +1 -1
- package/dist/TapniAuth.es.js +1 -1
- package/dist/TapniAuth.umd.js +8 -8
- package/dist/blank.html +31 -0
- package/dist/{install-CBFqB-tX.js → install-DJ7V1wyP.js} +761 -744
- package/dist/site.webmanifest +11 -1
- package/dist/style.css +1 -1
- package/package.json +14 -4
- package/src/.prettierrc.json +16 -0
- package/src/components/DELETE_LinkIcon.vue +174 -225
- package/src/components/DELETE_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 +3 -2
- package/src/mixins/global.mixin.js +2 -2
- package/src/mixins/google.mixin.js +53 -54
- package/src/mixins/qr-auth.mixin.js +111 -107
- package/src/router/index.js +6 -6
- package/src/routes.js +1 -1
- package/src/services/Api.js +55 -57
- 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/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/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 +2 -2
- package/src/views/Callback.vue +36 -33
- package/src/views/Login.vue +3 -3
- package/src/views/Reset.vue +132 -135
- package/src/views/Verify.vue +153 -151
|
@@ -8,221 +8,259 @@ import srLocale from '../store/locales/sr';
|
|
|
8
8
|
import trLocale from '../store/locales/tr';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
11
|
+
getFirstBrowserLanguage() {
|
|
12
|
+
let nav = window.navigator;
|
|
13
|
+
let browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];
|
|
14
|
+
let i;
|
|
15
|
+
let language;
|
|
16
|
+
|
|
17
|
+
// support for HTML 5.1 "navigator.languages"
|
|
18
|
+
if (Array.isArray(nav.languages)) {
|
|
19
|
+
for (i = 0; i < nav.languages.length; i++) {
|
|
20
|
+
language = nav.languages[i];
|
|
21
|
+
if (language && language.length) {
|
|
22
|
+
return language.slice(0, 2);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// support for other well known properties in browsers
|
|
28
|
+
for (i = 0; i < browserLanguagePropertyKeys.length; i++) {
|
|
29
|
+
language = nav[browserLanguagePropertyKeys[i]];
|
|
30
|
+
if (language && language.length) {
|
|
31
|
+
return language.slice(0, 2);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return null;
|
|
36
|
+
},
|
|
37
|
+
compareLangKeys() {
|
|
38
|
+
const en = Object.keys(enLocale.default.state);
|
|
39
|
+
const de = Object.keys(deLocale.default.state);
|
|
40
|
+
const es = Object.keys(esLocale.default.state);
|
|
41
|
+
const kr = Object.keys(krLocale.default.state);
|
|
42
|
+
const it = Object.keys(itLocale.default.state);
|
|
43
|
+
const fr = Object.keys(frLocale.default.state);
|
|
44
|
+
const sr = Object.keys(srLocale.default.state);
|
|
45
|
+
const tr = Object.keys(trLocale.default.state);
|
|
46
|
+
|
|
47
|
+
// Compare en and de
|
|
48
|
+
console.log(
|
|
49
|
+
'In en but not in de',
|
|
50
|
+
en.filter((x) => !de.includes(x))
|
|
51
|
+
);
|
|
52
|
+
console.log(
|
|
53
|
+
'In de but not in en',
|
|
54
|
+
de.filter((x) => !en.includes(x))
|
|
55
|
+
);
|
|
56
|
+
console.log();
|
|
57
|
+
|
|
58
|
+
// Compare en and es
|
|
59
|
+
console.log(
|
|
60
|
+
'In en but not in es',
|
|
61
|
+
en.filter((x) => !es.includes(x))
|
|
62
|
+
);
|
|
63
|
+
console.log(
|
|
64
|
+
'In es but not in en',
|
|
65
|
+
es.filter((x) => !en.includes(x))
|
|
66
|
+
);
|
|
67
|
+
console.log();
|
|
68
|
+
|
|
69
|
+
// Compare en and kr
|
|
70
|
+
console.log(
|
|
71
|
+
'In en but not in kr',
|
|
72
|
+
en.filter((x) => !kr.includes(x))
|
|
73
|
+
);
|
|
74
|
+
console.log(
|
|
75
|
+
'In kr but not in en',
|
|
76
|
+
kr.filter((x) => !en.includes(x))
|
|
77
|
+
);
|
|
78
|
+
console.log();
|
|
79
|
+
|
|
80
|
+
// Compare en and it
|
|
81
|
+
console.log(
|
|
82
|
+
'In en but not in it',
|
|
83
|
+
en.filter((x) => !it.includes(x))
|
|
84
|
+
);
|
|
85
|
+
console.log(
|
|
86
|
+
'In it but not in en',
|
|
87
|
+
it.filter((x) => !en.includes(x))
|
|
88
|
+
);
|
|
89
|
+
console.log();
|
|
90
|
+
|
|
91
|
+
// Compare en and fr
|
|
92
|
+
console.log(
|
|
93
|
+
'In en but not in fr',
|
|
94
|
+
en.filter((x) => !fr.includes(x))
|
|
95
|
+
);
|
|
96
|
+
console.log(
|
|
97
|
+
'In fr but not in en',
|
|
98
|
+
fr.filter((x) => !en.includes(x))
|
|
99
|
+
);
|
|
100
|
+
console.log();
|
|
101
|
+
|
|
102
|
+
// Compare en and sr
|
|
103
|
+
console.log(
|
|
104
|
+
'In en but not in sr',
|
|
105
|
+
en.filter((x) => !sr.includes(x))
|
|
106
|
+
);
|
|
107
|
+
console.log(
|
|
108
|
+
'In sr but not in en',
|
|
109
|
+
sr.filter((x) => !en.includes(x))
|
|
110
|
+
);
|
|
111
|
+
console.log();
|
|
112
|
+
|
|
113
|
+
// Compare en and tr
|
|
114
|
+
console.log(
|
|
115
|
+
'In en but not in tr',
|
|
116
|
+
en.filter((x) => !tr.includes(x))
|
|
117
|
+
);
|
|
118
|
+
console.log(
|
|
119
|
+
'In tr but not in en',
|
|
120
|
+
tr.filter((x) => !en.includes(x))
|
|
121
|
+
);
|
|
122
|
+
console.log();
|
|
123
|
+
},
|
|
124
|
+
base64ImageToBlob(base64Image) {
|
|
125
|
+
// Split into two parts
|
|
126
|
+
const parts = base64Image.split(';base64,');
|
|
127
|
+
|
|
128
|
+
// Hold the content type
|
|
129
|
+
const imageType = parts[0].split(':')[1];
|
|
130
|
+
|
|
131
|
+
// Decode Base64 string
|
|
132
|
+
const decodedData = window.atob(parts[1]);
|
|
133
|
+
|
|
134
|
+
// Create UNIT8ARRAY of size same as row data length
|
|
135
|
+
const uInt8Array = new Uint8Array(decodedData.length);
|
|
136
|
+
|
|
137
|
+
// Insert all character code into uInt8Array
|
|
138
|
+
for (let i = 0; i < decodedData.length; ++i) {
|
|
139
|
+
uInt8Array[i] = decodedData.charCodeAt(i);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Return BLOB image after conversion
|
|
143
|
+
return new Blob([uInt8Array], { type: imageType });
|
|
144
|
+
},
|
|
145
|
+
blobToBase64(blob) {
|
|
146
|
+
const reader = new FileReader();
|
|
147
|
+
reader.readAsDataURL(blob);
|
|
148
|
+
return new Promise((resolve) => {
|
|
149
|
+
reader.onloadend = () => {
|
|
150
|
+
resolve(reader.result);
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
base64toFile(base64, filename) {
|
|
155
|
+
var arr = base64.split(','),
|
|
156
|
+
mime = arr[0].match(/:(.*?);/)[1],
|
|
157
|
+
bstr = atob(arr[1]),
|
|
158
|
+
n = bstr.length,
|
|
159
|
+
u8arr = new Uint8Array(n);
|
|
160
|
+
|
|
161
|
+
while (n--) {
|
|
162
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return new File([u8arr], filename, { type: mime });
|
|
166
|
+
},
|
|
167
|
+
fileToBase64(file) {
|
|
168
|
+
new Promise((resolve, reject) => {
|
|
169
|
+
const reader = new FileReader();
|
|
170
|
+
reader.readAsDataURL(file);
|
|
171
|
+
reader.onload = () => resolve(reader.result);
|
|
172
|
+
reader.onerror = (error) => reject(error);
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
getUTMParams(data) {
|
|
176
|
+
let utm = {};
|
|
177
|
+
if (data.utm_source) utm.utm_source = data.utm_source;
|
|
178
|
+
if (data.utm_medium) utm.utm_medium = data.utm_medium;
|
|
179
|
+
if (data.utm_campaign) utm.utm_campaign = data.utm_campaign;
|
|
180
|
+
if (data.utm_term) utm.utm_term = data.utm_term;
|
|
181
|
+
if (data.utm_content) utm.utm_content = data.utm_content;
|
|
182
|
+
return utm;
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
cropCardScan(base64PictureData, callback) {
|
|
186
|
+
// image will contain ORIGINAL image
|
|
187
|
+
const image = new window.Image();
|
|
188
|
+
|
|
189
|
+
// image will contain CROPPED image
|
|
190
|
+
const canvas = document.createElement('canvas');
|
|
191
|
+
const ctx = canvas.getContext('2d');
|
|
192
|
+
|
|
193
|
+
// Load original image into image element
|
|
194
|
+
image.src = 'data:image/jpeg;base64,' + base64PictureData;
|
|
195
|
+
image.onload = () => {
|
|
196
|
+
const sw = image.width;
|
|
197
|
+
const sh = image.width / 1.65;
|
|
198
|
+
const sx = 0;
|
|
199
|
+
const sy = image.height / 2 - sh / 2;
|
|
200
|
+
const dw = sw;
|
|
201
|
+
const dh = sh;
|
|
202
|
+
canvas.width = dw;
|
|
203
|
+
canvas.height = dh;
|
|
204
|
+
// https://i.stack.imgur.com/USDAX.png
|
|
205
|
+
ctx.drawImage(image, sx, sy, sw, sh, 0, 0, dw, dh); // Crop interpolated rectangle
|
|
206
|
+
const croppedBase64Image = canvas.toDataURL();
|
|
207
|
+
|
|
208
|
+
callback(croppedBase64Image);
|
|
209
|
+
|
|
210
|
+
return croppedBase64Image;
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
generateRandomString(length) {
|
|
214
|
+
let array = new Uint32Array(length);
|
|
215
|
+
window.crypto.getRandomValues(array);
|
|
216
|
+
return Array.from(array, (dec) => ('0' + dec.toString(16)).substr(-2)).join('');
|
|
217
|
+
},
|
|
218
|
+
async pkceChallengeFromVerifier(v) {
|
|
219
|
+
const encoder = new TextEncoder();
|
|
220
|
+
const data = encoder.encode(v);
|
|
221
|
+
const hashed = await window.crypto.subtle.digest('SHA-256', data);
|
|
222
|
+
// base64 url encode
|
|
223
|
+
return btoa(String.fromCharCode.apply(null, new Uint8Array(hashed)))
|
|
224
|
+
.replace(/\+/g, '-')
|
|
225
|
+
.replace(/\//g, '_')
|
|
226
|
+
.replace(/=+$/, '');
|
|
227
|
+
},
|
|
228
|
+
encryptAES(key, iv, data) {
|
|
229
|
+
let encoder = new TextEncoder();
|
|
230
|
+
let encoded = encoder.encode(data, storage);
|
|
231
|
+
return window.crypto.subtle.encrypt(
|
|
232
|
+
{
|
|
233
|
+
name: 'AES-CBC',
|
|
234
|
+
iv: iv
|
|
235
|
+
},
|
|
236
|
+
key,
|
|
237
|
+
encoded
|
|
238
|
+
);
|
|
239
|
+
},
|
|
240
|
+
async decryptAES(key, iv, data) {
|
|
241
|
+
try {
|
|
242
|
+
const fromBase64 = (base64String) => Uint8Array.from(atob(base64String), (c) => c.charCodeAt(0));
|
|
243
|
+
|
|
244
|
+
data = data.replace(/ /g, '+');
|
|
245
|
+
|
|
246
|
+
const encoder = new TextEncoder();
|
|
247
|
+
const decoder = new TextDecoder();
|
|
248
|
+
|
|
249
|
+
key = encoder.encode(key);
|
|
250
|
+
iv = encoder.encode(iv);
|
|
251
|
+
data = fromBase64(data, storage);
|
|
252
|
+
|
|
253
|
+
const secretKey = await window.crypto.subtle.importKey('raw', key, 'AES-CBC', true, ['encrypt', 'decrypt']);
|
|
254
|
+
|
|
255
|
+
let decoded = await window.crypto.subtle.decrypt({ name: 'AES-CBC', iv }, secretKey, data);
|
|
256
|
+
|
|
257
|
+
decoded = decoder.decode(decoded);
|
|
258
|
+
decoded = decoded.replace(/ /g, '+');
|
|
259
|
+
decoded = atob(decoded);
|
|
260
|
+
|
|
261
|
+
return decoded;
|
|
262
|
+
} catch (err) {
|
|
263
|
+
console.log(err);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
package/src/store/event-bus.js
CHANGED
|
@@ -3,28 +3,28 @@ import { reactive, readonly } from 'vue';
|
|
|
3
3
|
const listeners = reactive(new Map());
|
|
4
4
|
|
|
5
5
|
export const EventBus = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
$on(event, listener) {
|
|
7
|
+
let eventListeners = listeners.get(event);
|
|
8
|
+
if (!eventListeners) {
|
|
9
|
+
eventListeners = new Set();
|
|
10
|
+
listeners.set(event, eventListeners);
|
|
11
|
+
}
|
|
12
|
+
eventListeners.add(listener);
|
|
13
|
+
},
|
|
14
|
+
$emit(event, ...args) {
|
|
15
|
+
const eventListeners = listeners.get(event);
|
|
16
|
+
if (eventListeners) {
|
|
17
|
+
for (const listener of eventListeners) {
|
|
18
|
+
listener(...args);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
$off(event, listener) {
|
|
23
|
+
const eventListeners = listeners.get(event);
|
|
24
|
+
if (eventListeners) {
|
|
25
|
+
eventListeners.delete(listener);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export default readonly(EventBus);
|