Skip to content

Commit

Permalink
Add StrategyService
Browse files Browse the repository at this point in the history
  • Loading branch information
aapomm committed Sep 25, 2023
1 parent 8c0093a commit effeec2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class SessionsController < ApplicationController
skip_before_action :verify_authenticity_token, only: :failure

def create
warden.authenticate!
warden.authenticate!(*StrategyService.strategies)
redirect_to_target_or_default root_url
end

Expand Down
9 changes: 9 additions & 0 deletions app/services/strategy_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class StrategyService
@@strategies = [:shared_password]

class << self
attr_accessor :strategies
end

ActiveSupport.run_load_hooks(:strategy_service)
end

0 comments on commit effeec2

Please sign in to comment.