fix: account management url visibility (#32645)
(cherry picked from commit 22fe7b4179464c73d7e0487df90f2064fa30a5e0)
This commit is contained in:
@@ -33974,6 +33974,11 @@
|
||||
},
|
||||
"UserConfigOAuthDto": {
|
||||
"properties": {
|
||||
"accountManagementUrl": {
|
||||
"default": "",
|
||||
"description": "Account management URL",
|
||||
"type": "string"
|
||||
},
|
||||
"autoLaunch": {
|
||||
"description": "Auto launch",
|
||||
"type": "boolean"
|
||||
|
||||
@@ -1616,6 +1616,8 @@ export type UserConfigNotificationsDto = {
|
||||
smtp: UserConfigSmtpDto;
|
||||
};
|
||||
export type UserConfigOAuthDto = {
|
||||
/** Account management URL */
|
||||
accountManagementUrl?: string;
|
||||
/** Auto launch */
|
||||
autoLaunch: boolean;
|
||||
/** Button text */
|
||||
|
||||
@@ -303,7 +303,8 @@ const AdminConfigSchemaWithVisibility = z
|
||||
accountManagementUrl: emptyOrUrl('Account management URL must be an empty string or a valid URL')
|
||||
.describe('Account management URL')
|
||||
.optional()
|
||||
.default(''),
|
||||
.default('')
|
||||
.meta({ visibility: User }),
|
||||
scope: z.string().describe('Scope'),
|
||||
prompt: z.string().describe('OAuth prompt parameter (e.g. select_account, login, consent)'),
|
||||
endSessionEndpoint: emptyOrUrl('endSessionEndpoint must be an empty string or a valid URL').describe(
|
||||
|
||||
@@ -9,15 +9,9 @@
|
||||
import { fade } from 'svelte/transition';
|
||||
import { createPreloadedQuery } from '$lib/queries/client';
|
||||
import { getUserConfigQuery } from '$lib/queries/config-user.query';
|
||||
import { getServerConfigQuery } from '$lib/queries/server.query';
|
||||
|
||||
const queries = {
|
||||
config: createPreloadedQuery(getUserConfigQuery),
|
||||
serverConfig: createPreloadedQuery(getServerConfigQuery),
|
||||
};
|
||||
|
||||
const config = $derived(queries.config.data);
|
||||
const serverConfig = $derived(queries.serverConfig.data);
|
||||
const query = createPreloadedQuery(getUserConfigQuery);
|
||||
const config = $derived(query.data);
|
||||
|
||||
let loading = $state(true);
|
||||
|
||||
@@ -58,8 +52,8 @@
|
||||
</div>
|
||||
{:else if config.oauth.enabled}
|
||||
{#if authManager.user.oauthId}
|
||||
{#if serverConfig.oauthAccountManagementUrl}
|
||||
<Button shape="round" size="small" href={serverConfig.oauthAccountManagementUrl}
|
||||
{#if config.oauth.accountManagementUrl}
|
||||
<Button shape="round" size="small" href={config.oauth.accountManagementUrl}
|
||||
>{$t('manage_oauth_account')}</Button
|
||||
>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user