diff --git a/frontend/src/stores/config.ts b/frontend/src/stores/config.ts index 3504a4f46..e02952511 100644 --- a/frontend/src/stores/config.ts +++ b/frontend/src/stores/config.ts @@ -32,6 +32,9 @@ export interface ConfigState { local: { enabled: boolean, }, + ldap: { + enabled: boolean, + }, openidConnect: { enabled: boolean, redirectUrl: string, @@ -66,6 +69,9 @@ export const useConfigStore = defineStore('config', () => { local: { enabled: true, }, + ldap: { + enabled: false, + }, openidConnect: { enabled: false, redirectUrl: '', diff --git a/frontend/src/views/user/Login.vue b/frontend/src/views/user/Login.vue index d0940c649..df077f2e8 100644 --- a/frontend/src/views/user/Login.vue +++ b/frontend/src/views/user/Login.vue @@ -16,7 +16,7 @@ {{ errorMessage }}
@@ -55,6 +55,7 @@ for="password" >{{ $t('user.auth.password') }} configStore.registrationEnabled) const localAuthEnabled = computed(() => configStore.auth.local.enabled) +const ldapAuthEnabled = computed(() => configStore.auth.ldap.enabled) const openidConnect = computed(() => configStore.auth.openidConnect) const hasOpenIdProviders = computed(() => openidConnect.value.enabled && openidConnect.value.providers?.length > 0) diff --git a/pkg/routes/api/v1/info.go b/pkg/routes/api/v1/info.go index 8bd16e76b..5c514c873 100644 --- a/pkg/routes/api/v1/info.go +++ b/pkg/routes/api/v1/info.go @@ -55,11 +55,12 @@ type vikunjaInfos struct { } type authInfo struct { - Local localAuthInfo `json:"local"` - OpenIDConnect openIDAuthInfo `json:"openid_connect"` + Local enabledAuthInfo `json:"local"` + Ldap enabledAuthInfo `json:"ldap"` + OpenIDConnect openIDAuthInfo `json:"openid_connect"` } -type localAuthInfo struct { +type enabledAuthInfo struct { Enabled bool `json:"enabled"` } @@ -87,7 +88,7 @@ func Info(c echo.Context) error { Motd: config.ServiceMotd.GetString(), LinkSharingEnabled: config.ServiceEnableLinkSharing.GetBool(), MaxFileSize: config.FilesMaxSize.GetString(), - RegistrationEnabled: config.ServiceEnableRegistration.GetBool(), + RegistrationEnabled: config.AuthLocalEnabled.GetBool() && config.ServiceEnableRegistration.GetBool(), TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(), TotpEnabled: config.ServiceEnableTotp.GetBool(), CaldavEnabled: config.ServiceEnableCaldav.GetBool(), @@ -106,9 +107,12 @@ func Info(c echo.Context) error { PrivacyPolicyURL: config.LegalPrivacyURL.GetString(), }, AuthInfo: authInfo{ - Local: localAuthInfo{ + Local: enabledAuthInfo{ Enabled: config.AuthLocalEnabled.GetBool(), }, + Ldap: enabledAuthInfo{ + Enabled: config.AuthLdapEnabled.GetBool(), + }, OpenIDConnect: openIDAuthInfo{ Enabled: config.AuthOpenIDEnabled.GetBool(), },