Fix SEMAPHORE_PASSWORD_LOGIN_DISABLED to properly disable login forms #3270
+30,777
−30,773
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
SEMAPHORE_PASSWORD_LOGIN_DISABLED=true
environment variable was not working as expected - instead of disabling the login form entirely, it was showing an email-based login form as a fallback.Problem
When users set
SEMAPHORE_PASSWORD_LOGIN_DISABLED=true
(typically for OIDC/LDAP-only environments), they expected the login form to be completely disabled. However, the frontend was showing an email login form instead:Before (incorrect behavior):
SEMAPHORE_PASSWORD_LOGIN_DISABLED=true
→ Shows email login formRoot Cause
The frontend logic assumed that when password login is disabled, email login should be shown as a fallback. However, email authentication is controlled by a separate configuration (
SEMAPHORE_EMAIL_2TP_ENABLED
) that wasn't being exposed to the frontend.Solution
Backend changes:
login_with_email
field to the/api/auth/login
responseutil.Config.Auth.Email.Enabled
statusFrontend changes:
Auth.vue
to check bothloginWithPassword
andloginWithEmail
settingsloginWithEmail
is explicitlytrue
Behavior After Fix
SEMAPHORE_PASSWORD_LOGIN_DISABLED=true
SEMAPHORE_PASSWORD_LOGIN_DISABLED=true
+SEMAPHORE_EMAIL_2TP_ENABLED=true
API Changes
The fix adds one field to the login metadata response:
This change is backward compatible - existing clients will ignore the new field.
Screenshots
Fixed behavior - Password login disabled:

Email authentication when explicitly enabled:

Fixes #3225.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.