Commit fd4022a5 authored by Kent Shikama's avatar Kent Shikama

Fix pronto remarks

parent 773a5a67
@import 'perfect-scrollbar';
@import 'color-variables';
@import "bootstrap-complete.scss";
@import 'bootstrap-complete';
@import 'mixins';
......@@ -99,11 +99,11 @@
@import 'statistics';
/* gallery */
@import "blueimp-gallery";
@import "gallery";
@import 'blueimp-gallery';
@import 'gallery';
// settings
@import 'user_applications';
// API
@import "openid_connect_error_page";
// OpenID Connect (API)
@import 'openid_connect_error_page';
.api-error {
margin-top: 20px;
box-shadow: $card-shadow;
background-color: $light-grey;
box-shadow: $card-shadow;
margin-top: 20px;
h4 { text-align: center; }
}
......@@ -3,7 +3,7 @@ module Api
class AuthorizationsController < ApplicationController
rescue_from Rack::OAuth2::Server::Authorize::BadRequest do |e|
logger.info e.backtrace[0, 10].join("\n")
error, description = e.message.split(" :: ")
error, _description = e.message.split(" :: ")
handle_params_error(error, "The request was malformed: please double check the client id and redirect uri.")
end
......@@ -210,17 +210,7 @@ module Api
def handle_prompt_none
if params[:prompt] == "none"
if user_signed_in?
client_id = params[:client_id]
if client_id
auth = Api::OpenidConnect::Authorization.find_by_client_id_and_user(client_id, current_user)
if auth
process_authorization_consent("true")
else
handle_params_error("interaction_required", "User must already be authorized when `prompt` is `none`")
end
else
handle_params_error("bad_request", "Client ID is missing from request")
end
handle_prompt_with_signed_in_user
else
handle_params_error("login_required", "User must already be logged in when `prompt` is `none`")
end
......@@ -229,6 +219,20 @@ module Api
end
end
def handle_prompt_with_signed_in_user
client_id = params[:client_id]
if client_id
auth = Api::OpenidConnect::Authorization.find_by_client_id_and_user(client_id, current_user)
if auth
process_authorization_consent("true")
else
handle_params_error("interaction_required", "User must already be authorized when `prompt` is `none`")
end
else
handle_params_error("bad_request", "Client ID is missing from request")
end
end
def render_error(error_description)
@error_description = error_description
render "api/openid_connect/error/error",
......
......@@ -37,4 +37,3 @@ end
Then(/^I should see a message containing "(.*?)"$/) do |message|
expect(find("#openid_connect_error_description").text).to eq(message)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment