Class: Api::OpenidConnect::AuthorizationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/api/openid_connect/authorizations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


38
39
40
41
# File 'app/controllers/api/openid_connect/authorizations_controller.rb', line 38

def create
  restore_request_parameters
  process_authorization_consent(params[:approve])
end

#destroyObject


43
44
45
46
47
48
49
50
51
# File 'app/controllers/api/openid_connect/authorizations_controller.rb', line 43

def destroy
  authorization = Api::OpenidConnect::Authorization.find_by(id: params[:id])
  if authorization
    authorization.destroy
  else
    flash[:error] = I18n.t("api.openid_connect.authorizations.destroy.fail", id: params[:id])
  end
  redirect_to api_openid_connect_user_applications_url
end

#newObject


24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/api/openid_connect/authorizations_controller.rb', line 24

def new
  auth = Api::OpenidConnect::Authorization.find_by_client_id_user_and_scopes(params[:client_id],
                                                                             current_user, params[:scope])
  reset_auth(auth)
  if logged_in_before?(params[:max_age])
    reauthenticate(params)
  elsif params[:prompt]
    prompt = params[:prompt].split(" ")
    handle_prompt(prompt, auth)
  else
    handle_authorization_form(auth)
  end
end