@tapni/auth 0.0.36 → 0.0.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -283,7 +283,7 @@ export default {
283
283
  return console.log("Redirect URI not allowed");
284
284
  }
285
285
 
286
- location.href =
286
+ location.href = -
287
287
  this.redirect_uri +
288
288
  "?code=" +
289
289
  response.data.auth_code +
@@ -329,12 +329,7 @@ export default {
329
329
  }
330
330
  },
331
331
  async exchangeAuthCode(data) {
332
- const [err, response] = await to(
333
- axios.post(import.meta.env.VITE_APP_API_ROOT + "/v1/users/auth-code", {
334
- code: data.code,
335
- code_verifier: data.code_verifier,
336
- })
337
- );
332
+ const [err, response] = await to(AuthService.exchangeAuthCode(data, this.storage));
338
333
  if (err) return this.errorHandler(err);
339
334
  await this.loginSetup(response);
340
335
  await this.getLoggedInAccounts();
@@ -474,7 +469,6 @@ export default {
474
469
  }
475
470
  },
476
471
  getRefreshTokens() {
477
- console.log('getRefreshTokens', this.$storage, this.$storageApp);
478
472
  return this.$storage.refreshTokens.split(',');
479
473
  },
480
474
  setRefreshToken(token) {
@@ -489,7 +483,6 @@ export default {
489
483
  EventBus.$emit("ssoEvent", { name: "setRefreshToken", data: token });
490
484
  },
491
485
  setToken(token) {
492
- console.log('setup token')
493
486
  this.$storage.token = token;
494
487
  this.token = token;
495
488
  EventBus.$emit("ssoEvent", { name: "setToken", data: token });
@@ -4,9 +4,15 @@ import { version } from "../../package.json"
4
4
  import AuthMixin from "../mixins/auth.mixin"
5
5
 
6
6
  export default (storage, refreshTokenAction = false) => {
7
- const appInfo = version
7
+ const appInfo = version;
8
+ let baseURL = import.meta.env.VITE_APP_API_ROOT + '/v1/';
9
+
10
+ if (location.hostname.includes('dev.')) {
11
+ baseURL = 'https://api-dev.tapni.co'
12
+ }
13
+
8
14
  let apiInstance = axios.create({
9
- baseURL: import.meta.env.VITE_APP_API_ROOT + '/v1/',
15
+ baseURL,
10
16
  headers: {
11
17
  Authorization: `Bearer ${storage.token}`,
12
18
  "X-Client-Name": "sso-" + appInfo.platform,
@@ -67,5 +67,8 @@ export default {
67
67
  },
68
68
  samlLoginUrl (data, storage) {
69
69
  return Api(storage).post('/saml/url', data)
70
- }
70
+ },
71
+ exchangeAuthCode (data, storage) {
72
+ return Api(storage).post('/v1/users/auth-code', data)
73
+ },
71
74
  }
@@ -199,9 +199,6 @@ export default {
199
199
  try {
200
200
  const fromBase64 = base64String => Uint8Array.from(atob(base64String), c => c.charCodeAt(0));
201
201
 
202
- //console.log("key: " + key);
203
- //console.log("iv: " + iv);
204
-
205
202
  data = data.replace(/ /g, '+');
206
203
 
207
204
  const encoder = new TextEncoder();
@@ -24,7 +24,7 @@
24
24
  />
25
25
  </i>
26
26
  </a>
27
- <h1 class="bold no-bottom center-text" style="margin-top: 63px;" @click="bum">
27
+ <h1 class="bold no-bottom center-text" style="margin-top: 63px;">
28
28
  {{ this.ssoLang[this.appLanguage].login }}
29
29
  </h1>
30
30
  <p class="half-bottom small-top center-text color-black"></p>
@@ -329,10 +329,6 @@ export default {
329
329
  }
330
330
  },
331
331
  methods: {
332
- bum () {
333
- console.log('lo', this.$storage);
334
- this.$storage.verifyEmail = '123123123';
335
- },
336
332
  async submit() {
337
333
  // if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
338
334
  if (this.submitted) return;