From 7a075d78a3ff1cec012fd9123af3a073a43a468c Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Wed, 31 Jan 2024 14:18:40 -0500 Subject: [PATCH] fix(web): oauth login (#6813) --- web/src/api/utils.ts | 3 +-- web/src/routes/auth/login/+page.svelte | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/api/utils.ts b/web/src/api/utils.ts index 9671eb115e..3b4f4d3ec3 100644 --- a/web/src/api/utils.ts +++ b/web/src/api/utils.ts @@ -1,4 +1,3 @@ -import { goto } from '$app/navigation'; import type { AxiosError, AxiosPromise } from 'axios'; import { notificationController, @@ -45,7 +44,7 @@ export const oauth = { try { const redirectUri = location.href.split('?')[0]; const { data } = await api.oauthApi.startOAuth({ oAuthConfigDto: { redirectUri } }); - goto(data.url); + window.location.href = data.url; } catch (error) { handleError(error, 'Unable to login with OAuth'); } diff --git a/web/src/routes/auth/login/+page.svelte b/web/src/routes/auth/login/+page.svelte index 07584e00be..7ead2e2d93 100644 --- a/web/src/routes/auth/login/+page.svelte +++ b/web/src/routes/auth/login/+page.svelte @@ -11,7 +11,7 @@ export let data: PageData; afterNavigate(async ({ from }) => { - if (from?.url.pathname === AppRoute.AUTH_CHANGE_PASSWORD) { + if (from?.url?.pathname === AppRoute.AUTH_CHANGE_PASSWORD) { resetSavedUser(); await api.authenticationApi.logout(); }