Skip to content

High performance self-hosted photo and video management solution.

fix(web): oauth login (#6813)

Jason Rasmussen7a075d78a3ff
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();
}