Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@
*/
'auth.webauthn.enabled' => true,

/**
* By default the login form is always available. There are cases (SSO) where an
* admin wants to avoid users entering their credentials to the system if the SSO
* app is unavailable.
*
* This will show an error. But the the direct login still works with adding ?direct=1
*/
'hide_login_form' => false,

/**
* The directory where the skeleton files are located. These files will be
* copied to the data directory of new users. Leave empty to not copy any
Expand Down
2 changes: 2 additions & 0 deletions core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ public function showLoginForm(string $user = null, string $redirect_url = null):

$this->initialStateService->provideInitialState('core', 'webauthn-available', $this->webAuthnManager->isWebAuthnAvailable());

$this->initialStateService->provideInitialState('core', 'hideLoginForm', $this->config->getSystemValueBool('hide_login_form', false));

// OpenGraph Support: http://ogp.me/
Util::addHeader('meta', ['property' => 'og:title', 'content' => Util::sanitizeHTML($this->defaults->getName())]);
Util::addHeader('meta', ['property' => 'og:description', 'content' => Util::sanitizeHTML($this->defaults->getSlogan())]);
Expand Down
2 changes: 1 addition & 1 deletion core/js/dist/login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/login.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/src/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ new View({
hasPasswordless: fromStateOr('webauthn-available', false),
isHttps: window.location.protocol === 'https:',
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined',
hideLoginForm: fromStateOr('hideLoginForm', false),
},
}).$mount('#login')
15 changes: 14 additions & 1 deletion core/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->

<template>
<div>
<div v-if="!hideLoginForm || directLogin">
<transition name="fade" mode="out-in">
<div v-if="!passwordlessLogin && !resetPassword && resetPasswordTarget === ''"
key="login">
Expand Down Expand Up @@ -84,6 +84,15 @@
</div>
</transition>
</div>
<div v-else>
<transition name="fade" mode="out-in">
<div class="warning">
{{ t('core', 'Login form is disabled.') }}<br>
<small>{{ t('core', 'Please contact your administrator.') }}
</small>
</div>
</transition>
</div>
</template>

<script>
Expand Down Expand Up @@ -153,6 +162,10 @@ export default {
type: Boolean,
default: false,
},
hideLoginForm: {
type: Boolean,
default: false
}
},
data() {
return {
Expand Down