cobras-auth-nuxt 1.0.4 → 1.0.5
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/module.json
CHANGED
|
@@ -80,19 +80,17 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|
|
80
80
|
if (code) {
|
|
81
81
|
const success = await exchangeCode(code);
|
|
82
82
|
if (success) {
|
|
83
|
+
state.value.initialized = true;
|
|
83
84
|
const newQuery = { ...route.query };
|
|
84
85
|
delete newQuery.code;
|
|
85
|
-
|
|
86
|
+
const newUrl = new URL(window.location.href);
|
|
87
|
+
newUrl.searchParams.delete("code");
|
|
88
|
+
window.history.replaceState({}, "", newUrl.toString());
|
|
89
|
+
return;
|
|
86
90
|
} else {
|
|
87
91
|
const currentUrl = window.location.origin + window.location.pathname;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
query: {
|
|
91
|
-
error: "Authentication Failed",
|
|
92
|
-
message: "Unable to complete login. The authorization code may have expired.",
|
|
93
|
-
redirect_uri: currentUrl
|
|
94
|
-
}
|
|
95
|
-
});
|
|
92
|
+
window.location.href = `/_auth/error?error=Authentication%20Failed&message=Unable%20to%20complete%20login.&redirect_uri=${encodeURIComponent(currentUrl)}`;
|
|
93
|
+
return;
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
await checkAuth();
|