mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web,server): use feature flags for oauth (#3928)
* refactor: oauth to use feature flags * chore: open api * chore: e2e test for authorize endpoint
This commit is contained in:
parent
c7d53a5006
commit
a26ed3d1a6
26 changed files with 660 additions and 110 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import type { AxiosError, AxiosPromise } from 'axios';
|
||||
import {
|
||||
notificationController,
|
||||
|
|
@ -32,9 +33,17 @@ export const oauth = {
|
|||
}
|
||||
return false;
|
||||
},
|
||||
authorize: async (location: Location) => {
|
||||
try {
|
||||
const redirectUri = location.href.split('?')[0];
|
||||
const { data } = await api.oauthApi.authorizeOAuth({ oAuthConfigDto: { redirectUri } });
|
||||
goto(data.url);
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to login with OAuth');
|
||||
}
|
||||
},
|
||||
getConfig: (location: Location) => {
|
||||
const redirectUri = location.href.split('?')[0];
|
||||
console.log(`OAuth Redirect URI: ${redirectUri}`);
|
||||
return api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri } });
|
||||
},
|
||||
login: (location: Location) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue