@tapni/auth 1.0.8 → 1.0.10
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-RvuCmVZn.js} +1 -1
- package/dist/{Billing-C7LjeXBV.js → Billing-Cl-Go20Z.js} +1 -1
- package/dist/{CustomApp-Cd00FwXJ.js → CustomApp-CZq-1s27.js} +1 -1
- package/dist/{General-DH-AnLIA.js → General-B4mMzmcc.js} +1 -1
- package/dist/{QR-cfWsMTIZ.js → QR-BNOCCI9L.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-DqdbJ4A1.js} +760 -743
- 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/Reset.vue +132 -135
- package/src/views/Verify.vue +153 -151
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import to from 'await-to-js'
|
|
2
|
-
import AuthService from '../services/AuthService'
|
|
3
|
-
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth'
|
|
4
|
-
import {EventBus} from
|
|
1
|
+
import to from 'await-to-js';
|
|
2
|
+
import AuthService from '../services/AuthService';
|
|
3
|
+
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
|
|
4
|
+
import { EventBus } from '../store/event-bus';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
googleLoad: false
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
computed: {
|
|
13
|
+
displayGoogleLogin() {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
mounted() {
|
|
18
|
+
GoogleAuth.initialize();
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
async googleLogin() {
|
|
22
|
+
this.googleLoad = true;
|
|
23
|
+
let [errAuth, user] = await to(GoogleAuth.signIn());
|
|
24
|
+
if (errAuth) return (this.googleLoad = false);
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (errAuth) return this.googleLoad = false
|
|
26
|
+
// Track Referrals
|
|
27
|
+
if (this.referral) user.ref = this.referral;
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
if (user.authentication && (user.authentication.accessToken || user.authentication.idToken)) {
|
|
30
|
+
// Track Referrals
|
|
31
|
+
if (this.referral) user.ref = this.referral;
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (this.referral) user.ref = this.referral;
|
|
33
|
+
// Code Login
|
|
34
|
+
if (this.display === 'popup') user.response_type = 'code';
|
|
33
35
|
|
|
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
|
-
}
|
|
36
|
+
const [err, response] = await to(AuthService.googleSDK(user, this.$storex));
|
|
37
|
+
if (err) {
|
|
38
|
+
this.googleLoad = false;
|
|
39
|
+
EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
|
|
40
|
+
return this.errorHandler(err);
|
|
41
|
+
}
|
|
42
|
+
if (response.data.success) {
|
|
43
|
+
if (this.display === 'popup') {
|
|
44
|
+
return window.parent?.postMessage({ code: response.data.auth_code, state: this.$route.query.state }, '*');
|
|
45
|
+
}
|
|
46
|
+
await this.loginSetup(response);
|
|
47
|
+
await this.getLoggedInAccounts();
|
|
48
|
+
this.loginSuccess({ ...response, isModal: this.isModal });
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.googleLoad = false;
|
|
51
|
+
}, 1000);
|
|
52
|
+
} else this.errorSnack(this.ssoLang[this.appLanguage].unexpected_err);
|
|
53
|
+
} else {
|
|
54
|
+
this.googleLoad = false;
|
|
55
|
+
EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -1,117 +1,121 @@
|
|
|
1
|
-
import to from 'await-to-js'
|
|
2
|
-
import CompanyService from '../services/CompanyService'
|
|
3
|
-
import {nextTick} from
|
|
4
|
-
import QRCodeStyling from
|
|
1
|
+
import to from 'await-to-js';
|
|
2
|
+
import CompanyService from '../services/CompanyService';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import QRCodeStyling from 'qr-code-styling';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
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
|
-
let result = "";
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
isQrCodeLogin: false,
|
|
10
|
+
qrCode: null,
|
|
11
|
+
qrCodeHash: null,
|
|
12
|
+
qrCodeRefreshInterval: null,
|
|
13
|
+
poolingInterval: null
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
isModal: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
required: false,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
computed: {
|
|
24
|
+
displayQRLogin() {
|
|
25
|
+
return this.$route.name === 'AuthLogin' && this.display !== 'npm';
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
mounted() {
|
|
29
|
+
if (this.$route.name === 'AuthQR') this.changeLoginToQr();
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
async changeLoginToQr() {
|
|
33
|
+
this.isQrCodeLogin = true;
|
|
34
|
+
await nextTick();
|
|
35
|
+
await this.initQrCodeLogin();
|
|
36
|
+
},
|
|
37
|
+
generateRandomHash() {
|
|
38
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
39
|
+
const charactersLength = characters.length;
|
|
40
|
+
let result = '';
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
// Create an array of 32-bit unsigned integers
|
|
43
|
+
const randomValues = new Uint32Array(32);
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
// Generate random values
|
|
46
|
+
window.crypto.getRandomValues(randomValues);
|
|
47
|
+
randomValues.forEach((value) => {
|
|
48
|
+
result += characters.charAt(value % charactersLength);
|
|
49
|
+
});
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
return result;
|
|
52
|
+
},
|
|
53
|
+
refreshQrCode() {
|
|
54
|
+
if (this.qrCode) {
|
|
55
|
+
document.getElementById('qrCodeContainer')?.childNodes[0]?.remove();
|
|
56
|
+
}
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
this.qrCodeHash = this.generateRandomHash();
|
|
60
59
|
|
|
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
|
-
|
|
60
|
+
this.qrCode = new QRCodeStyling({
|
|
61
|
+
width: 300,
|
|
62
|
+
height: 300,
|
|
63
|
+
type: 'png',
|
|
64
|
+
image: '',
|
|
65
|
+
imageOptions: {
|
|
66
|
+
margin: 15
|
|
67
|
+
},
|
|
68
|
+
data: this.qrCodeHash,
|
|
69
|
+
dotsOptions: {
|
|
70
|
+
type: 'extra-rounded',
|
|
71
|
+
color: '#000000'
|
|
72
|
+
},
|
|
73
|
+
cornersSquareOptions: {
|
|
74
|
+
type: 'extra-rounded',
|
|
75
|
+
color: '#000000'
|
|
76
|
+
},
|
|
77
|
+
cornersDotOptions: {
|
|
78
|
+
type: '',
|
|
79
|
+
color: '#000000'
|
|
80
|
+
},
|
|
81
|
+
backgroundOptions: {
|
|
82
|
+
color: '#ffffff00'
|
|
83
|
+
}
|
|
84
|
+
});
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
this.qrCode.append(document.getElementById('qrCodeContainer'));
|
|
87
|
+
},
|
|
88
|
+
async startQrCodePooling() {
|
|
89
|
+
this.poolingInterval = setInterval(async () => {
|
|
90
|
+
const [err, response] = await to(
|
|
91
|
+
CompanyService.qrCodePooling(
|
|
92
|
+
{
|
|
93
|
+
qrToken: this.qrCodeHash
|
|
94
|
+
},
|
|
95
|
+
this.$storex
|
|
96
|
+
)
|
|
97
|
+
);
|
|
98
|
+
if (err) return this.errorHandler(err);
|
|
99
|
+
if (response.data.auth_code) {
|
|
100
|
+
if (this.display !== 'popup') {
|
|
101
|
+
this.loginSetup({ ...response, isModal: this.isModal });
|
|
102
|
+
await this.getLoggedInAccounts();
|
|
103
|
+
}
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
this.loginSuccess({ ...response, isModal: this.isModal });
|
|
106
|
+
clearInterval(this.poolingInterval);
|
|
107
|
+
clearInterval(this.qrCodeRefreshInterval);
|
|
108
|
+
}
|
|
109
|
+
}, 2000);
|
|
110
|
+
},
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
112
|
+
async initQrCodeLogin() {
|
|
113
|
+
this.refreshQrCode();
|
|
114
|
+
await nextTick();
|
|
115
|
+
await this.startQrCodePooling();
|
|
116
|
+
this.qrCodeRefreshInterval = setInterval(() => {
|
|
117
|
+
this.refreshQrCode();
|
|
118
|
+
}, 60000);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
package/src/router/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
-
import routes from '../routes.js'
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
2
|
+
import routes from '../routes.js';
|
|
3
3
|
|
|
4
4
|
const router = createRouter({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})
|
|
5
|
+
history: createWebHistory(import.meta.env.BASE_URL),
|
|
6
|
+
routes
|
|
7
|
+
});
|
|
8
8
|
|
|
9
|
-
export default router
|
|
9
|
+
export default router;
|
package/src/routes.js
CHANGED
package/src/services/Api.js
CHANGED
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { jwtDecode } from
|
|
3
|
-
import { version } from
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { jwtDecode } from 'jwt-decode';
|
|
3
|
+
import { version } from '../../package.json';
|
|
4
4
|
import store from '../store/store.js';
|
|
5
5
|
|
|
6
6
|
export default (refreshTokenAction = null) => {
|
|
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
|
-
return apiInstance;
|
|
60
|
-
}
|
|
7
|
+
const appInfo = version;
|
|
8
|
+
let baseURL = import.meta.env.VITE_APP_API_ROOT + '/v1/';
|
|
9
|
+
|
|
10
|
+
if (store.getters['auth/apiRoot']) {
|
|
11
|
+
baseURL = store.getters['auth/apiRoot'] + '/v1/';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let apiInstance = axios.create({
|
|
15
|
+
baseURL,
|
|
16
|
+
headers: {
|
|
17
|
+
Authorization: `Bearer ${store.getters['auth/accessToken']}`,
|
|
18
|
+
'X-Client-Name': 'sso-' + appInfo.platform,
|
|
19
|
+
'X-Client-Version': appInfo.version
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Add a request interceptor
|
|
24
|
+
apiInstance.interceptors.request.use(async function (config) {
|
|
25
|
+
if (['post', 'put', 'delete'].includes(config.method.toLowerCase())) {
|
|
26
|
+
config.data = {
|
|
27
|
+
...config.data,
|
|
28
|
+
lang: store.getters['auth/appLanguage'],
|
|
29
|
+
realm: store.getters['auth/appRealm'] || 'app'
|
|
30
|
+
};
|
|
31
|
+
} else if (config.method.toLowerCase() === 'get') {
|
|
32
|
+
config.params = {
|
|
33
|
+
...config.params,
|
|
34
|
+
lang: store.getters['auth/appLanguage'],
|
|
35
|
+
realm: store.getters['auth/appRealm'] || 'app'
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check refresh token expiration before request is sent
|
|
40
|
+
if (store.getters['auth/accessToken'] && !refreshTokenAction) {
|
|
41
|
+
const decoded = jwtDecode(store.getters['auth/accessToken']);
|
|
42
|
+
|
|
43
|
+
// Check if access token expired
|
|
44
|
+
if (decoded.exp - 30 < Math.floor(Date.now() / 1000)) {
|
|
45
|
+
return store.dispatch('auth/refreshTokenAction', decoded).then(() => {
|
|
46
|
+
config.headers = {
|
|
47
|
+
...config.headers,
|
|
48
|
+
Authorization: `Bearer ${store.getters['auth/accessToken']}`
|
|
49
|
+
};
|
|
50
|
+
return config;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return config;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return apiInstance;
|
|
58
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import api from './Api';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
4
|
+
getBySSOEmail(email) {
|
|
5
|
+
return api().get(`/company/sso/${email}`);
|
|
6
|
+
},
|
|
7
|
+
acceptCompanyInvitation(code) {
|
|
8
|
+
return api().get(`/users/invitation?ic=${code}`);
|
|
9
|
+
},
|
|
10
|
+
qrCodePooling(payload) {
|
|
11
|
+
return api().post('/company/login/qr', payload);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -2,9 +2,9 @@ import api from './Api';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
registerDevice(data) {
|
|
5
|
-
return api().post(`/devices/add`, data)
|
|
5
|
+
return api().post(`/devices/add`, data);
|
|
6
6
|
},
|
|
7
7
|
addFcmToken(data) {
|
|
8
|
-
return api().post(`/devices/fcm/add`, data)
|
|
8
|
+
return api().post(`/devices/fcm/add`, data);
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
};
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import api from './Api.js';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
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
|
-
|
|
4
|
+
getMe() {
|
|
5
|
+
return api().get(`/users/me`);
|
|
6
|
+
},
|
|
7
|
+
getByUsername(data) {
|
|
8
|
+
let referrer = document.referrer || '';
|
|
9
|
+
let params = data.utmParams || {};
|
|
10
|
+
if (data.dontTap) params.dontTap = true;
|
|
11
|
+
return api().get(`/users/${data.username}`, {
|
|
12
|
+
params,
|
|
13
|
+
headers: { 'X-Referer': referrer }
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
getByNumber(data) {
|
|
17
|
+
let referrer = document.referrer || '';
|
|
18
|
+
let params = data.utmParams || {};
|
|
19
|
+
if (data.dontTap) params.dontTap = true;
|
|
20
|
+
return api().get(`/users/tag/${data.serial}`, {
|
|
21
|
+
params,
|
|
22
|
+
headers: { 'X-Referer': referrer }
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
save(data) {
|
|
26
|
+
return api().put(`/users`, data);
|
|
27
|
+
},
|
|
28
|
+
newPassword(data) {
|
|
29
|
+
return api().put(`/users/new-password`, data);
|
|
30
|
+
},
|
|
31
|
+
connect(data) {
|
|
32
|
+
return api().post(`/users/connect`, data);
|
|
33
|
+
},
|
|
34
|
+
eventLog(data) {
|
|
35
|
+
return api().post(`/users/log`, data);
|
|
36
|
+
},
|
|
37
|
+
deleteAccount(data) {
|
|
38
|
+
return api().post(`/users/profile/delete`, data);
|
|
39
|
+
},
|
|
40
|
+
registerDevice(data) {
|
|
41
|
+
return api().post(`/users/device/register`, data);
|
|
42
|
+
},
|
|
43
|
+
addFcmToken(data) {
|
|
44
|
+
return api().post(`/users/device/fcm`, data);
|
|
45
|
+
},
|
|
46
|
+
loginUsingQR(data) {
|
|
47
|
+
return api().post('/users/qr/login', data);
|
|
48
|
+
}
|
|
49
49
|
};
|