mirror of
https://github.com/dokploy/dokploy.git
synced 2026-06-13 19:09:49 +00:00
refactor: simplify forward authentication handling in UI and API
- Removed the selection of SSO providers from the UI, streamlining the process to enable/disable SSO for domains. - Updated the API to eliminate the need for a provider ID when enabling forward authentication, relying on the configured settings instead. - Enhanced user feedback by updating toast messages to reflect the current state of SSO authentication. - Improved the UI layout for better clarity on SSO status and actions. This refactor enhances the user experience by simplifying the SSO configuration process and ensuring clearer communication of actions taken.
This commit is contained in:
@@ -326,19 +326,16 @@ export const assertApplicationDomainAccess = async (
|
||||
|
||||
export const enableForwardAuthOnDomain = async (input: {
|
||||
domainId: string;
|
||||
providerId: string;
|
||||
organizationId: string;
|
||||
}) => {
|
||||
const { application } = await resolveApplicationDomain(input.domainId);
|
||||
await findProviderForOrg(input.providerId, input.organizationId);
|
||||
const serverId = application.serverId ?? undefined;
|
||||
|
||||
const settings = await getForwardAuthSettings(serverId ?? null);
|
||||
if (!settings) {
|
||||
if (!settings?.providerId) {
|
||||
throw new TRPCError({
|
||||
code: "PRECONDITION_FAILED",
|
||||
message:
|
||||
"Set the authentication domain and deploy the proxy for this server first.",
|
||||
"Deploy the authentication proxy for this server in SSO settings first.",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -352,7 +349,7 @@ export const enableForwardAuthOnDomain = async (input: {
|
||||
}
|
||||
|
||||
await updateDomainById(input.domainId, {
|
||||
forwardAuthProviderId: input.providerId,
|
||||
forwardAuthProviderId: settings.providerId,
|
||||
});
|
||||
const domain = await findDomainById(input.domainId);
|
||||
await manageDomain(application, domain);
|
||||
|
||||
Reference in New Issue
Block a user