Streamline login for single provider instances (#2720) - #2728
Merged
Conversation
Send the user straight to the provider when it is the only way to log in, rather than showing a login page containing a single button. This only applies to providers that redirect out to an external service - LDAP and the SEEK password form still need the login page to collect credentials. Registering is never skipped, as the terms and conditions have to be accepted first. /auth/:provider is POST only, so this is a self submitting form rather than a redirect, with the button left visible as a fallback. A requested strategy or a flash error suppresses it, so a failed login lands on the login page instead of bouncing straight back to the provider. Hide the Register links when registration is disabled, and enforce that on POST /users, which previously still created accounts. The login panel footer also drops the password reset link when there is no SEEK password to reset, and disappears entirely when neither link applies.
Sending the user straight to the provider changes the login flow for everyone on an instance that has turned off the standard login, which isn't always wanted - landing on an unfamiliar site can be disorienting, and going back from the provider returns to the login page and is redirected out again. Add "omniauth_skip_login_page" so an administrator opts in, alongside the standard login setting it pairs with.
Rename show_standard_password_login? to show_password_login? so that every strategy in LOGIN_STRATEGIES answers to show_<strategy>_login?, and available_login_strategies can dispatch on the name alone without special casing the password login. Derive REDIRECTING_LOGIN_STRATEGIES by taking out the two that have a form to fill in, rather than listing the rest a second time. A provider added to LOGIN_STRATEGIES is then treated as redirecting by default, which is what an omniauth provider almost always is.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves UX and correctness for instances that route authentication through a single external OmniAuth/OIDC provider by (1) hiding registration entry points when registration is disabled and (2) optionally skipping the interim “single provider” login page via a new admin setting.
Changes:
- Hide “Register” links/buttons across the navbar, home page, and login panel footer when
registration_disabledis enabled; enforce the same rule server-side by blockingPOST /users. - Add
omniauth_skip_login_page(default: off) to auto-submit a POST to/auth/:providerwhen there is exactly one redirecting login provider available, while avoiding redirects on explicit strategy selection or failed login. - Rename
show_standard_password_login?toshow_password_login?and expand test coverage for the new behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/functional/users_controller_test.rb | Adds coverage for registration-disabled enforcement and ensures registration page is not auto-skipped. |
| test/functional/sessions_controller_test.rb | Adds coverage for auto-skipping login page under a single redirecting provider and verifies suppression conditions. |
| test/functional/homes_controller_test.rb | Verifies home-page “Register” button is hidden when registration is disabled. |
| lib/seek/config_setting_attributes.yml | Registers new omniauth_skip_login_page configuration setting. |
| config/initializers/seek_configuration.rb | Defines default value for omniauth_skip_login_page (false). |
| app/views/users/new.html.erb | Updates view logic to use show_password_login?. |
| app/views/sessions/new.html.erb | Renders new auto-login partial when auto_login_strategy applies. |
| app/views/sessions/_auto_login.html.erb | New auto-submitting POST form to initiate OmniAuth login while keeping a visible fallback button. |
| app/views/layouts/navbar/_navbar.html.erb | Hides navbar “Register” link when registration is disabled. |
| app/views/homes/_home_features.html.erb | Hides home “Register” button when registration is disabled. |
| app/views/gadgets/_sign_in.html.erb | Uses show_password_login? and conditionally hides footer links when registration/password reset aren’t applicable. |
| app/views/admin/_omniauth.html.erb | Adds admin checkbox setting for omniauth_skip_login_page. |
| app/helpers/sessions_helper.rb | Implements strategy selection helpers and the auto_login_strategy decision logic; renames show_* helper. |
| app/controllers/users_controller.rb | Enforces registration_disabled at controller level for user creation. |
| app/controllers/admin_controller.rb | Persists omniauth_skip_login_page from the admin settings form. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fbacall
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2720
Two dead ends reported on an instance that routes all users through a single OIDC provider (Keycloak).
Register button
The Register link stayed visible when
registration_disabledwas set, leading only to a page saying registration is not available. It is now hidden in the navbar, on the home page and in the login panel footer. The explanation remains on/signupfor anyone arriving there directly.While in there:
registration_disabledwas only ever a view level check, soPOST /usersstill created accounts. That is now enforced in the controller.Interim login page
With one provider configured and the standard login turned off, clicking "Log in" showed a page containing a single "Sign in with Keycloak" button. When enabled, the user is now sent straight to the provider instead.
This is behind a new admin setting,
omniauth_skip_login_page, off by default, so nothing changes for existing instances until an administrator opts in. It only applies when a single provider is the only way in and that provider redirects out to an external service - LDAP and the standard login collect credentials in SEEK, so they still need the page. Registering is never skipped, as the terms and conditions have to be accepted first./auth/:provideris POST only, so this is a self submitting form rather than a redirect, with the button left visible as a fallback where JavaScript is unavailable. A requested strategy or a flash error suppresses it, so a failed login lands on the login page rather than bouncing straight back to the provider.Also
The login panel footer drops the password reset link when the standard login is not shown, as there is no SEEK password to reset.
Notes for review
omniauth_skip_login_pageis a new setting and will want a line in the release notes. Sören will need to enable it to get the behaviour from the issue.show_standard_password_login?is renamed toshow_password_login?so every strategy answers toshow_<strategy>_login?and the lookup can dispatch on the name alone.