@tapni/auth 1.0.5 → 1.0.6-3.dev

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 (78) hide show
  1. package/README.md +2 -0
  2. package/dist/.vite/manifest.json +16 -43
  3. package/dist/.well-known/assetlinks.json +10 -12
  4. package/dist/.well-known/microsoft-identity-association.json +5 -5
  5. package/dist/{Apps-DMds3Dv-.js → Apps-XNA4_3B4.js} +34 -34
  6. package/dist/Billing-Br0-fHed.js +256 -0
  7. package/dist/CustomApp-CrlbYDOm.js +83 -0
  8. package/dist/QR-Bvqb60-E.js +41 -0
  9. package/dist/TapniAuth.es.js +1 -1
  10. package/dist/TapniAuth.umd.js +49 -23
  11. package/dist/{install-L-cxSovH.js → install-7FOVy8Ol.js} +6267 -4743
  12. package/dist/site.webmanifest +11 -1
  13. package/dist/style.css +1 -1
  14. package/dist/{web-IFGkBi0t.js → web-UrTMimK1.js} +2 -2
  15. package/package.json +65 -55
  16. package/src/.prettierrc.json +16 -0
  17. package/src/App.vue +326 -269
  18. package/src/eslint.config.js +15 -0
  19. package/src/index.js +4 -0
  20. package/src/install.js +9 -10
  21. package/src/main.js +54 -57
  22. package/src/mixins/apple.mixin.js +56 -54
  23. package/src/mixins/auth.mixin.js +3 -2
  24. package/src/mixins/global.mixin.js +3 -3
  25. package/src/mixins/google.mixin.js +53 -54
  26. package/src/mixins/microsoft.mixin.js +2 -5
  27. package/src/mixins/okta.mixin.js +1 -1
  28. package/src/mixins/qr-auth.mixin.js +111 -107
  29. package/src/mixins/saml.mixin.js +82 -45
  30. package/src/router/index.js +6 -6
  31. package/src/routes.js +1 -1
  32. package/src/services/Api.js +56 -58
  33. package/src/services/AuthService.js +7 -9
  34. package/src/services/CompanyService.js +10 -10
  35. package/src/services/DeviceService.js +3 -3
  36. package/src/services/UserService.js +48 -45
  37. package/src/services/UtilService.js +317 -225
  38. package/src/store/auth.js +485 -549
  39. package/src/store/constants.js +2 -2
  40. package/src/store/event-bus.js +22 -22
  41. package/src/store/locales/cn.js +476 -458
  42. package/src/store/locales/de.js +478 -517
  43. package/src/store/locales/en.js +454 -513
  44. package/src/store/locales/es.js +477 -524
  45. package/src/store/locales/fr.js +477 -516
  46. package/src/store/locales/it.js +477 -514
  47. package/src/store/locales/ja.js +488 -0
  48. package/src/store/locales/kr.js +477 -491
  49. package/src/store/locales/lang.js +51 -43
  50. package/src/store/locales/pt.js +488 -0
  51. package/src/store/locales/sr.js +477 -492
  52. package/src/store/locales/tr.js +477 -487
  53. package/src/store/store.js +6 -6
  54. package/src/views/Account.vue +36 -8
  55. package/src/views/Billing.vue +464 -34
  56. package/src/views/Callback.vue +36 -33
  57. package/src/views/General.vue +151 -185
  58. package/src/views/Login.vue +2 -25
  59. package/src/views/Register.vue +2 -12
  60. package/src/views/Reset.vue +132 -135
  61. package/src/views/Security.vue +13 -7
  62. package/src/views/Verify.vue +153 -151
  63. package/src/views/Welcome.vue +85 -71
  64. package/dist/Account-Cuz87g_8.js +0 -153
  65. package/dist/Billing-BXlQEuNy.js +0 -113
  66. package/dist/CustomApp-CLCMXmMO.js +0 -83
  67. package/dist/General-dW73bMoR.js +0 -479
  68. package/dist/QR-D6ZGcPM0.js +0 -41
  69. package/dist/index.css +0 -193
  70. package/dist/web-AXRKjAOB.js +0 -92
  71. package/src/components/DELETE_Language.vue +0 -168
  72. package/src/components/DELETE_LinkIcon.vue +0 -288
  73. package/src/components/DELETE_ModalOverlay.vue +0 -68
  74. package/src/components/DELETE_OTP.vue +0 -105
  75. package/src/components/DELETE_SSO.vue +0 -120
  76. package/src/components/DELETE_SSOPick.vue +0 -166
  77. package/src/mixins/DELETE_mfa-auth.mixin.js +0 -53
  78. package/src/mixins/facebook.mixin.js +0 -78
@@ -1,117 +1,121 @@
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";
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
- 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 =
39
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
40
- const charactersLength = characters.length;
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
- // Create an array of 32-bit unsigned integers
44
- const randomValues = new Uint32Array(32);
42
+ // Create an array of 32-bit unsigned integers
43
+ const randomValues = new Uint32Array(32);
45
44
 
46
- // Generate random values
47
- window.crypto.getRandomValues(randomValues);
48
- randomValues.forEach((value) => {
49
- result += characters.charAt(value % charactersLength);
50
- });
45
+ // Generate random values
46
+ window.crypto.getRandomValues(randomValues);
47
+ randomValues.forEach((value) => {
48
+ result += characters.charAt(value % charactersLength);
49
+ });
51
50
 
52
- return result;
53
- },
54
- refreshQrCode() {
55
- if (this.qrCode) {
56
- document.getElementById("qrCodeContainer")?.childNodes[0]?.remove();
57
- }
51
+ return result;
52
+ },
53
+ refreshQrCode() {
54
+ if (this.qrCode) {
55
+ document.getElementById('qrCodeContainer')?.childNodes[0]?.remove();
56
+ }
58
57
 
59
- this.qrCodeHash = this.generateRandomHash();
58
+ this.qrCodeHash = this.generateRandomHash();
60
59
 
61
- this.qrCode = new QRCodeStyling({
62
- width: 300,
63
- height: 300,
64
- type: "png",
65
- image: "",
66
- imageOptions: {
67
- margin: 15,
68
- },
69
- data: this.qrCodeHash,
70
- dotsOptions: {
71
- type: "extra-rounded",
72
- color: "#000000",
73
- },
74
- cornersSquareOptions: {
75
- type: "extra-rounded",
76
- color: "#000000",
77
- },
78
- cornersDotOptions: {
79
- type: "",
80
- color: "#000000",
81
- },
82
- backgroundOptions: {
83
- color: "#ffffff00",
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
- this.qrCode.append(document.getElementById("qrCodeContainer"));
88
- },
89
- async startQrCodePooling() {
90
- this.poolingInterval = setInterval(async () => {
91
- const [err, response] = await to(CompanyService.qrCodePooling({
92
- qrToken: this.qrCodeHash,
93
- }, this.$storex));
94
- if (err) return this.errorHandler(err);
95
- if (response.data.auth_code) {
96
- if (this.display !== 'popup') {
97
- this.loginSetup({ ...response, isModal: this.isModal });
98
- await this.getLoggedInAccounts();
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
- this.loginSuccess({ ...response, isModal: this.isModal });
102
- clearInterval(this.poolingInterval);
103
- clearInterval(this.qrCodeRefreshInterval);
104
- }
105
- }, 2000);
106
- },
105
+ this.loginSuccess({ ...response, isModal: this.isModal });
106
+ clearInterval(this.poolingInterval);
107
+ clearInterval(this.qrCodeRefreshInterval);
108
+ }
109
+ }, 2000);
110
+ },
107
111
 
108
- async initQrCodeLogin() {
109
- this.refreshQrCode();
110
- await nextTick();
111
- await this.startQrCodePooling();
112
- this.qrCodeRefreshInterval = setInterval(() => {
113
- this.refreshQrCode();
114
- }, 60000);
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
+ };
@@ -2,86 +2,123 @@ import { Browser } from '@capacitor/browser';
2
2
  import UtilService from '@/services/UtilService';
3
3
  import { Capacitor } from "@capacitor/core";
4
4
  import { EventBus } from '@/store/event-bus.js';
5
+
5
6
  export default {
6
- data () {
7
+ data() {
7
8
  return {
8
9
  code_verifier: '',
9
- code_challenge: ''
10
- }
10
+ code_challenge: '',
11
+ shouldCloseWindow: false,
12
+ popupWindow: null,
13
+ checkInterval: null
14
+ };
11
15
  },
12
16
  computed: {
13
17
  },
14
18
  watch: {
15
- /*
16
- '$route.path': async function(routePath) {
17
- await this.handleSamlRedirect(routePath)
19
+ '$route.path'(nv) {
20
+ if (nv === '/callback/saml') {
21
+ this.handleSamlRedirect(nv)
22
+ }
18
23
  }
19
- */
20
24
  },
21
25
  methods: {
22
- async samlLogin (loginUrl) {
23
-
26
+ closeWindow() {
27
+ try {
28
+ window.close()
29
+ } catch (e) {
30
+ // Window close error
31
+ }
32
+ },
33
+ async samlLogin(loginUrl) {
24
34
  // Create and store a new PKCE code_verifier (the plaintext random secret)
25
35
  this.code_verifier = UtilService.generateRandomString(28);
26
36
  localStorage.setItem("pkce_code_verifier", this.code_verifier);
27
37
 
28
38
  // Hash and base64-urlencode the secret to use as the challenge
29
39
  this.code_challenge = await UtilService.pkceChallengeFromVerifier(this.code_verifier);
30
-
31
40
  const platform = Capacitor.getPlatform();
32
41
 
33
42
  // append public key as relayState
34
- let dataString = `code_challenge=${this.code_challenge}&platform=${platform}&redirect_uri=${(location.origin + '/callback/saml')}&realm=${this.$storex.realm}`;
43
+ let dataString = `code_challenge=${this.code_challenge}&platform=${platform}&redirect_uri=${location.origin + (this.display === 'npm' ? '/app' : '') + '/callback/saml'}&realm=${this.realm}&display=${this.display}`;
35
44
  let relayState = btoa(dataString);
36
-
37
45
  loginUrl = `${loginUrl}&RelayState=${relayState}`
38
46
 
39
47
  let self = this;
40
48
 
41
- window.addEventListener("message", async (message)=> {
42
- if (!this.allowedOriginsAuth.includes(message.origin)) return console.log('Origin is not allowed!');
43
- if(message.data.type === 'saml' && message.data.code) {
44
- if (this.display === 'popup') {
45
- return window.parent?.postMessage({ code: message.data.code, state: this.$route.query.state, code_verifier: localStorage.getItem("pkce_code_verifier") }, '*');
49
+ window.addEventListener(
50
+ 'message',
51
+ async (message) => {
52
+ if (!this.allowedOriginsAuth.includes(message.origin)) return console.error('Origin is not allowed! ' + message.origin);
53
+ const code = message.data.code;
54
+ const pkce = localStorage.getItem('pkce_code_verifier');
55
+ if (code) {
56
+ if (self.display === 'popup') {
57
+ return window.parent?.postMessage({ code: code, state: message.data.state, code_verifier: pkce }, '*');
58
+ }
59
+ if (pkce) {
60
+ await self.exchangeAuthCode({ code: message.data.code, code_verifier: pkce });
61
+ localStorage.removeItem('pkce_code_verifier');
62
+ }
46
63
  }
47
- await self.exchangeAuthCode({code: message.data.code, code_verifier: localStorage.getItem("pkce_code_verifier")});
48
- localStorage.removeItem("pkce_code_verifier");
49
- }
50
- }, { once: true });
64
+ },
65
+ { once: true }
66
+ );
51
67
 
52
- let popupWindow;
53
- if(this.isNative) {
54
- popupWindow = await Browser.open({ url: loginUrl, presentationStyle: 'popover'});
68
+ if (this.isNative) {
69
+ this.popupWindow = await Browser.open({ url: loginUrl, presentationStyle: 'popover' });
70
+ } else {
71
+ this.checkInterval = setInterval(() => {
72
+ // check localStorage
73
+ const code = localStorage.getItem('auth_code');
74
+ const pkce = localStorage.getItem('pkce_code_verifier');
75
+
76
+ if (code) {
77
+ clearInterval(this.checkInterval);
78
+ localStorage.removeItem('auth_code');
79
+ localStorage.removeItem('pkce_code_verifier');
80
+
81
+ // handle code exchange
82
+ window.parent?.postMessage({ code: code, state: this.$route.query.state, code_verifier: pkce }, '*');
83
+
84
+ if (pkce && (this.display === 'npm' || this.display === 'redirect')) {
85
+ this.exchangeAuthCode({ code, code_verifier: pkce });
86
+ }
87
+ }
88
+ }, 500);
89
+
90
+ this.popupWindow = window.open(window.location.origin + (this.display === 'npm' ? '/app' : '') + '/callback/redirect?uri=' + btoa(loginUrl), 'popup', 'width=600,height=600');
55
91
  }
56
- else popupWindow = window.open(loginUrl, 'popup','width=600,height=600')
57
- /*
58
- popupWindow.addEventListener('beforeunload', () => {
59
- console.log('window closed')
60
- })
61
- */
62
92
  },
63
93
  async handleSamlRedirect() {
64
94
  let code;
65
- let postMessageData = {type: 'saml'}
66
- if (this.$route.query.code) postMessageData.code = this.$route.query.code;
67
- if(window.opener) {
68
- window.opener.postMessage(postMessageData, location.origin);
69
- window.close()
95
+ if (this.$route.query.code) {
96
+ code = this.$route.query.code
97
+ }
98
+ if (window.opener) {
99
+ window.opener.postMessage({ type: 'saml', code }, '*');
100
+ this.closeWindow();
70
101
  } else {
71
- if(this.isNative && this.isiOS) await Browser.close();
72
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: true})
73
- if (this.$route.query.code) code = this.$route.query.code
74
-
75
- console.log(this.display, {code});
102
+ if (this.isNative && this.isiOS) await Browser.close();
103
+ EventBus.$emit('ssoEvent', { name: 'setLoading', data: true });
76
104
 
77
105
  if (code) {
78
- if (this.display === 'popup') {
79
- return window.parent?.postMessage({ code: code, state: this.$route.query.state }, '*');
106
+ if (this.display === 'popup' || this.display === 'npm') {
107
+ localStorage.setItem('auth_code', code);
108
+ this.shouldCloseWindow = true;
109
+ window.parent?.postMessage({ code: code, state: this.$route.query.state }, '*');
110
+ this.closeWindow()
111
+ }
112
+ // TODO: Replace URLs with .env variables to support staging
113
+ if (this.display === 'redirect' || location.host === 'auth.tapni.com') {
114
+ let redirect_url = 'https://auth.tapni.com/callback/auth';
115
+ if (this.realm === 'dashboard') {
116
+ redirect_url = 'https://business.tapni.com/login'
117
+ }
118
+ return location.href = redirect_url + '?code=' + code + '&code_verifier=' + localStorage.getItem('pkce_code_verifier');
80
119
  }
81
- await this.exchangeAuthCode({code, code_verifier: localStorage.getItem("pkce_code_verifier")});
82
120
  }
83
- localStorage.removeItem("pkce_code_verifier");
84
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
121
+ EventBus.$emit('ssoEvent', { name: 'setLoading', data: false });
85
122
  }
86
123
  }
87
124
  },
@@ -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
- history: createWebHistory(import.meta.env.BASE_URL),
6
- routes
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
@@ -26,7 +26,7 @@ export default [
26
26
  {
27
27
  path: "/callback/saml",
28
28
  name: "Callback",
29
- alias: ['/callback/okta', '/callback/auth'],
29
+ alias: ['/callback/okta', '/callback/auth', '/callback/redirect'],
30
30
  component: Callback,
31
31
  },
32
32
  {
@@ -1,60 +1,58 @@
1
- import axios from 'axios'
2
- import { jwtDecode } from "jwt-decode";
3
- import { version } from "../../package.json"
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
- export default (refreshTokenAction = null) => {
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
-
26
- if (['post', 'put', 'delete'].includes(config.method.toLowerCase())) {
27
- config.data = {
28
- ...config.data,
29
- lang: store.getters['auth/appLanguage'],
30
- realm: store.getters['auth/appRealm'] || 'app'
31
- }
32
- } else if (config.method.toLowerCase() === 'get') {
33
- config.params = {
34
- ...config.params,
35
- lang: store.getters['auth/appLanguage'],
36
- realm: store.getters['auth/appRealm'] || 'app'
37
- }
38
- }
39
-
40
- // Check refresh token expiration before request is sent
41
- if (store.getters['auth/accessToken'] && !refreshTokenAction) {
42
- const decoded = jwtDecode(store.getters['auth/accessToken'])
43
-
44
- // Check if access token expired
45
- if (decoded.exp - 30 < Math.floor(Date.now() / 1000)) {
46
- return store.dispatch('auth/refreshTokenAction', decoded)
47
- .then(() => {
48
- config.headers = {
49
- ...config.headers,
50
- Authorization: `Bearer ${store.getters['auth/accessToken']}`
51
- }
52
- return config;
53
- })
54
- }
55
- }
56
- return config;
57
- });
58
-
59
- return apiInstance;
60
- }
6
+ export default (refreshTokenAction = null, version = 'v1') => {
7
+ const appInfo = version;
8
+ let baseURL = import.meta.env.VITE_APP_API_ROOT + '/' + version + '/';
9
+
10
+ if (store.getters['auth/apiRoot']) {
11
+ baseURL = store.getters['auth/apiRoot'] + '/' + version + '/';
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
+ };
@@ -33,7 +33,13 @@ export default {
33
33
  })
34
34
  },
35
35
  verify (data) {
36
- return api().get('/users/verify?c=' + data.code + '&e=' + data.email + '&captchatoken=' + data.captchaToken)
36
+ return api().get('/users/verify', {
37
+ params: {
38
+ c: data.code,
39
+ e: data.email,
40
+ captchatoken: data.captchaToken
41
+ }
42
+ });
37
43
  },
38
44
  googleUrl (storage) {
39
45
  return api().get('/users/google/url')
@@ -42,18 +48,10 @@ export default {
42
48
  data.device_id = deviceID
43
49
  return api().post('/users/google', data)
44
50
  },
45
- facebook (data) {
46
- data.device_id = deviceID
47
- return api().post('/users/facebook', data)
48
- },
49
51
  googleSDK (data) {
50
52
  data.device_id = deviceID
51
53
  return api().post('/users/google/sdk', data)
52
54
  },
53
- facebookSDK (data) {
54
- data.device_id = deviceID
55
- return api().post('/users/facebook/sdk', data)
56
- },
57
55
  appleSDK (data) {
58
56
  data.device_id = deviceID
59
57
  return api().post('/users/apple/sdk', data)
@@ -1,13 +1,13 @@
1
1
  import api from './Api';
2
2
 
3
3
  export default {
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
- }
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
+ };