@tapni/auth 0.0.86 → 0.0.88
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 +831 -835
- package/dist/TapniAuth.umd.js +3 -3
- package/package.json +1 -1
- package/src/App.vue +2 -2
- package/src/mixins/auth.mixin.js +2 -2
- package/src/services/Api.js +0 -4
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
32
32
|
<AuthVerify v-else-if="initialized && renderView === 'AuthVerify'" :isModal="isModal" />
|
|
33
33
|
<AuthReset v-else-if="initialized && renderView === 'AuthReset'" />
|
|
34
34
|
<AuthCallback v-else-if="initialized && renderView === 'AuthCallback'" />
|
|
35
|
-
<RouterView v-else
|
|
35
|
+
<RouterView v-else-if="display !== 'npm'" />
|
|
36
36
|
|
|
37
37
|
<div class="snackbar snackbar-boxed" id="snackbar">
|
|
38
38
|
<p class="snack-body" id="errorSnack">
|
|
@@ -135,7 +135,7 @@ export default {
|
|
|
135
135
|
this.setToken(this.$storage.token);
|
|
136
136
|
const refreshTokens = this.getRefreshTokens();
|
|
137
137
|
this.setRefreshToken(refreshTokens[0]);
|
|
138
|
-
await this.getLoggedInAccounts();
|
|
138
|
+
await this.getLoggedInAccounts(refreshTokens);
|
|
139
139
|
|
|
140
140
|
// Let App know that the auth is ready
|
|
141
141
|
this.$emit('ssoLibraryReady', this.$storage);
|
package/src/mixins/auth.mixin.js
CHANGED
|
@@ -449,8 +449,8 @@ export default {
|
|
|
449
449
|
return response.data;
|
|
450
450
|
}
|
|
451
451
|
},
|
|
452
|
-
async getLoggedInAccounts() {
|
|
453
|
-
|
|
452
|
+
async getLoggedInAccounts(refreshTokens) {
|
|
453
|
+
if (!refreshTokens) refreshTokens = this.getRefreshTokens();
|
|
454
454
|
if (refreshTokens && refreshTokens.length >= 1) {
|
|
455
455
|
const [err, response] = await to(
|
|
456
456
|
AuthService.getLoggedInAccounts({ refreshTokens }, this.$storage)
|
package/src/services/Api.js
CHANGED
|
@@ -49,14 +49,10 @@ export default {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
console.log('before interceptor enter', storage, refreshTokenAction);
|
|
53
|
-
|
|
54
52
|
// Check refresh token expiration before request is sent
|
|
55
53
|
if (storage && storage.token && !refreshTokenAction) {
|
|
56
54
|
const decoded = jwtDecode(storage.token)
|
|
57
55
|
|
|
58
|
-
console.log('interceptor enter', decoded, decoded.exp - 30 < Math.floor(Date.now() / 1000));
|
|
59
|
-
|
|
60
56
|
// Check if access token expired
|
|
61
57
|
if (decoded.exp - 30 < Math.floor(Date.now() / 1000)) {
|
|
62
58
|
|