9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/warden/oauth2/failure_app.rb', line 9
def call(env)
warden = env['warden']
strategy = warden.winning_strategy
error_description = strategy.respond_to?(:error_description) ? strategy.error_description : ''
body = {}
body[:error] = strategy.message
body[:error_description] = error_description
body = JSON.dump(body)
status = strategy.error_status
= {'Content-Type' => 'application/json'}
['X-Accepted-OAuth-Scopes'] = (strategy.scope || :public).to_s
[status, , [body]]
end
|