Class: Castle::FailoverAuthResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/castle/failover_auth_response.rb

Overview

generate failover authentication response

Instance Method Summary collapse

Constructor Details

#initialize(user_id, strategy: Castle.config.failover_strategy, reason:) ⇒ FailoverAuthResponse

Returns a new instance of FailoverAuthResponse.



6
7
8
9
10
# File 'lib/castle/failover_auth_response.rb', line 6

def initialize(user_id, strategy: Castle.config.failover_strategy, reason:)
  @strategy = strategy
  @reason = reason
  @user_id = user_id
end

Instance Method Details

#generateObject



12
13
14
15
16
17
18
19
# File 'lib/castle/failover_auth_response.rb', line 12

def generate
  {
    action: @strategy.to_s,
    user_id: @user_id,
    failover: true,
    failover_reason: @reason
  }
end