Class: GrapeTokenAuth::OmniAuthFailureHTML

Inherits:
OmniAuthHTMLBase show all
Defined in:
lib/grape_token_auth/omniauth/omniauth_failure_html.rb

Constant Summary collapse

FAILURE_MESSAGE =
'authFailure'

Instance Method Summary collapse

Methods inherited from OmniAuthHTMLBase

#render_html

Constructor Details

#initialize(error_message) ⇒ OmniAuthFailureHTML

Returns a new instance of OmniAuthFailureHTML.



6
7
8
# File 'lib/grape_token_auth/omniauth/omniauth_failure_html.rb', line 6

def initialize(error_message)
  @error_message = error_message
end

Instance Method Details

#auth_origin_urlObject



10
11
12
# File 'lib/grape_token_auth/omniauth/omniauth_failure_html.rb', line 10

def auth_origin_url
  "/#?error=#{error_message}"
end

#json_post_dataObject



14
15
16
17
18
19
# File 'lib/grape_token_auth/omniauth/omniauth_failure_html.rb', line 14

def json_post_data
  {
    'message' => FAILURE_MESSAGE,
    'error'   => error_message
  }.to_json
end