Skip to content

Commit

Permalink
Signin is always enabled
Browse files Browse the repository at this point in the history
We've overloaded the :service_open feature flag so it's not possible to
enable DfE Signin without removing basic authentication.

Remove the feature flag to always enable DSI.

We already have a BYPASS_DSI environment variable we can use locally.
  • Loading branch information
gpeng committed Nov 22, 2023
1 parent f2f5c75 commit a41719c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class ApplicationController < ActionController::Base
default_form_builder(GOVUKDesignSystemFormBuilder::FormBuilder)

before_action :http_basic_authenticate, unless: -> { FeatureFlags::FeatureFlag.active?(:service_open) }
before_action :authenticate_dsi_user!, if: -> { FeatureFlags::FeatureFlag.active?(:service_open) }
before_action :handle_expired_session!, if: -> { FeatureFlags::FeatureFlag.active?(:service_open) }
before_action :authenticate_dsi_user!
before_action :handle_expired_session!

def http_basic_authenticate
valid_credentials = [
Expand Down
5 changes: 3 additions & 2 deletions spec/requests/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
)
end

it "returns http success" do
it "redirects to sign-in" do
get "/", env: { "HTTP_AUTHORIZATION" => credentials }
expect(response).to have_http_status(:success)
expect(response).to have_http_status(:redirect)
expect(response).to redirect_to("/sign-in")
end
end
end
Expand Down

0 comments on commit a41719c

Please sign in to comment.