mirror of
https://github.com/h44z/wg-portal.git
synced 2026-05-28 08:56:17 +00:00
fix vue and oauth redirects under web base path (#683)
This commit is contained in:
@@ -6,8 +6,10 @@ import {authStore} from '@/stores/auth'
|
||||
import {securityStore} from '@/stores/security'
|
||||
import {notify} from "@kyvg/vue3-notification";
|
||||
|
||||
const routerBase = `${WGPORTAL_BASE_PATH || ''}${import.meta.env.BASE_URL || '/'}`
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
history: createWebHashHistory(routerBase),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
|
||||
@@ -83,7 +83,9 @@ const externalLogin = function (provider) {
|
||||
console.log("Performing external login for provider", provider.Identifier);
|
||||
loggingIn.value = true;
|
||||
console.log(router.currentRoute.value);
|
||||
let currentUri = window.location.origin + "/#" + router.currentRoute.value.fullPath;
|
||||
const currentUrl = new URL(`${WGPORTAL_BASE_PATH || ''}${import.meta.env.BASE_URL || '/'}`, window.location.origin);
|
||||
currentUrl.hash = router.currentRoute.value.fullPath;
|
||||
let currentUri = currentUrl.toString();
|
||||
let redirectUrl = `${WGPORTAL_BACKEND_BASE_URL}${provider.ProviderUrl}`;
|
||||
redirectUrl += "?redirect=true";
|
||||
redirectUrl += "&return=" + encodeURIComponent(currentUri);
|
||||
|
||||
Reference in New Issue
Block a user