mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +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:
@@ -1,21 +1,22 @@
|
||||
import { api, ServerFeaturesDto } from '@api';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export type FeatureFlags = ServerFeaturesDto;
|
||||
export type FeatureFlags = ServerFeaturesDto & { loaded: boolean };
|
||||
|
||||
export const featureFlags = writable<FeatureFlags>({
|
||||
loaded: false,
|
||||
clipEncode: true,
|
||||
facialRecognition: true,
|
||||
sidecar: true,
|
||||
tagImage: true,
|
||||
search: true,
|
||||
oauth: true,
|
||||
oauthAutoLaunch: true,
|
||||
oauth: false,
|
||||
oauthAutoLaunch: false,
|
||||
passwordLogin: true,
|
||||
configFile: false,
|
||||
});
|
||||
|
||||
export const loadFeatureFlags = async () => {
|
||||
const { data } = await api.serverInfoApi.getServerFeatures();
|
||||
featureFlags.update(() => data);
|
||||
featureFlags.update(() => ({ ...data, loaded: true }));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user