1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

fix(web): oauth login (#6813)

This commit is contained in:
Jason Rasmussen 2024-01-31 14:18:40 -05:00 committed by GitHub
parent d2c2db2595
commit 7a075d78a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -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');
}

View file

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