diff --git a/docs/documentation/configuration/overview.md b/docs/documentation/configuration/overview.md index 2c76860..3611171 100644 --- a/docs/documentation/configuration/overview.md +++ b/docs/documentation/configuration/overview.md @@ -76,6 +76,7 @@ auth: webauthn: enabled: true min_password_length: 16 + hide_login_form: false web: listening_address: :8888 @@ -354,6 +355,12 @@ Some core authentication options are shared across all providers, while others a The default admin password strength is also enforced by this setting. - **Important:** The password should be strong and secure. It is recommended to use a password with at least 16 characters, including uppercase and lowercase letters, numbers, and special characters. +### `hide_login_form` +- **Default:** `false` +- **Description:** If `true`, the login form is hidden and only the OIDC, OAuth, LDAP, or WebAuthn providers are shown. This is useful if you want to enforce a specific authentication method. + If no social login providers are configured, the login form is always shown, regardless of this setting. +- **Important:** You can still access the login form by adding the `?all` query parameter to the login URL (e.g. https://wg.portal/#/login?all). + --- ### OIDC diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue index d5037e2..9003b83 100644 --- a/frontend/src/views/LoginView.vue +++ b/frontend/src/views/LoginView.vue @@ -16,7 +16,10 @@ const password = ref("") const usernameInvalid = computed(() => username.value === "") const passwordInvalid = computed(() => password.value === "") const disableLoginBtn = computed(() => username.value === "" || password.value === "" || loggingIn.value) - +const showLoginForm = computed(() => { + console.log(router.currentRoute.value.query) + return settings.Setting('LoginFormVisible') || router.currentRoute.value.query.hasOwnProperty('all'); +}); onMounted(async () => { await settings.LoadSettings() @@ -98,7 +101,7 @@ const externalLogin = function (provider) {