@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/dist/TapniAuth.es.js +391 -395
- package/dist/TapniAuth.umd.js +2 -2
- package/package.json +1 -1
- package/src/mixins/auth.mixin.js +2 -9
- package/src/services/Api.js +8 -2
- package/src/services/AuthService.js +4 -1
- package/src/services/UtilService.js +0 -3
- package/src/views/Login.vue +1 -5
package/package.json
CHANGED
package/src/mixins/auth.mixin.js
CHANGED
|
@@ -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 });
|
package/src/services/Api.js
CHANGED
|
@@ -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
|
|
15
|
+
baseURL,
|
|
10
16
|
headers: {
|
|
11
17
|
Authorization: `Bearer ${storage.token}`,
|
|
12
18
|
"X-Client-Name": "sso-" + appInfo.platform,
|
|
@@ -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();
|
package/src/views/Login.vue
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/>
|
|
25
25
|
</i>
|
|
26
26
|
</a>
|
|
27
|
-
<h1 class="bold no-bottom center-text" style="margin-top: 63px;"
|
|
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;
|