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,5 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { browser } from '$app/environment';
|
||||
import { page } from '$app/stores';
|
||||
import { featureFlags } from '$lib/stores/feature-flags.store';
|
||||
import { APIKeyResponseDto, AuthDeviceResponseDto, oauth, UserResponseDto } from '@api';
|
||||
import SettingAccordion from '../admin-page/settings/setting-accordion.svelte';
|
||||
import ChangePasswordSettings from './change-password-settings.svelte';
|
||||
@@ -9,7 +11,6 @@
|
||||
import PartnerSettings from './partner-settings.svelte';
|
||||
import UserAPIKeyList from './user-api-key-list.svelte';
|
||||
import UserProfileSettings from './user-profile-settings.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
export let user: UserResponseDto;
|
||||
|
||||
@@ -17,18 +18,10 @@
|
||||
export let devices: AuthDeviceResponseDto[] = [];
|
||||
export let partners: UserResponseDto[] = [];
|
||||
|
||||
let oauthEnabled = false;
|
||||
let oauthOpen = false;
|
||||
|
||||
onMount(async () => {
|
||||
if (browser) {
|
||||
oauthOpen = oauth.isCallback(window.location);
|
||||
try {
|
||||
const { data } = await oauth.getConfig(window.location);
|
||||
oauthEnabled = data.enabled;
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<SettingAccordion title="Account" subtitle="Manage your account">
|
||||
@@ -47,7 +40,7 @@
|
||||
<MemoriesSettings {user} />
|
||||
</SettingAccordion>
|
||||
|
||||
{#if oauthEnabled}
|
||||
{#if $featureFlags.loaded && $featureFlags.oauth}
|
||||
<SettingAccordion
|
||||
title="OAuth"
|
||||
subtitle="Manage your OAuth connection"
|
||||
|
||||
Reference in New Issue
Block a user