@tapni/auth 1.0.16 → 1.0.18
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/.vite/manifest.json +12 -12
- package/dist/{Apps-DgbnT61Y.js → Apps-rf8bGLGW.js} +1 -1
- package/dist/{Billing-CSZHUj6r.js → Billing-DeDNiiDa.js} +1 -1
- package/dist/{CustomApp-9V1Zs2Qk.js → CustomApp-NtrCIk_F.js} +1 -1
- package/dist/{General-CtJdOqp0.js → General-G-9IcU4l.js} +1 -1
- package/dist/{QR-CvamZkR6.js → QR-CTWsBUj7.js} +1 -1
- package/dist/TapniAuth.es.js +1 -1
- package/dist/TapniAuth.umd.js +3 -3
- package/dist/{install-C9X8ANE1.js → install-CcWeBFFw.js} +710 -709
- package/package.json +1 -1
- package/src/mixins/saml.mixin.js +9 -5
- package/src/store/auth.js +1 -1
package/package.json
CHANGED
package/src/mixins/saml.mixin.js
CHANGED
|
@@ -51,12 +51,16 @@ export default {
|
|
|
51
51
|
'message',
|
|
52
52
|
async (message) => {
|
|
53
53
|
if (!this.allowedOriginsAuth.includes(message.origin)) return console.log('Origin is not allowed! ' + message.origin);
|
|
54
|
-
|
|
54
|
+
const code = message.data.code;
|
|
55
|
+
const pkce = localStorage.getItem('pkce_code_verifier');
|
|
56
|
+
if (code) {
|
|
55
57
|
if (self.display === 'popup') {
|
|
56
|
-
return window.parent?.postMessage({ code:
|
|
58
|
+
return window.parent?.postMessage({ code: code, state: message.data.state, code_verifier: pkce }, '*');
|
|
59
|
+
}
|
|
60
|
+
if (pkce) {
|
|
61
|
+
await self.exchangeAuthCode({ code: message.data.code, code_verifier: pkce });
|
|
62
|
+
localStorage.removeItem('pkce_code_verifier');
|
|
57
63
|
}
|
|
58
|
-
await self.exchangeAuthCode({ code: message.data.code, code_verifier: localStorage.getItem('pkce_code_verifier') });
|
|
59
|
-
localStorage.removeItem('pkce_code_verifier');
|
|
60
64
|
}
|
|
61
65
|
},
|
|
62
66
|
{ once: true }
|
|
@@ -78,7 +82,7 @@ export default {
|
|
|
78
82
|
// handle code exchange
|
|
79
83
|
window.parent?.postMessage({ code: code, state: this.$route.query.state, code_verifier: pkce }, '*');
|
|
80
84
|
|
|
81
|
-
if (this.display === 'npm' || this.display === 'redirect') {
|
|
85
|
+
if (pkce && (this.display === 'npm' || this.display === 'redirect')) {
|
|
82
86
|
this.exchangeAuthCode({ code, code_verifier: pkce });
|
|
83
87
|
}
|
|
84
88
|
}
|
package/src/store/auth.js
CHANGED
|
@@ -278,7 +278,7 @@ export default {
|
|
|
278
278
|
})
|
|
279
279
|
);
|
|
280
280
|
if (err && err.response && err.response.data.error === "ACCESS_DENIED") {
|
|
281
|
-
dispatch('logout', { refreshToken:
|
|
281
|
+
dispatch('logout', { refreshToken: getters.refreshTokens[0], sendRequest: false });
|
|
282
282
|
return location.reload();
|
|
283
283
|
}
|
|
284
284
|
|