Skip to content

Commit

Permalink
Policial fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbutcher committed Jul 2, 2019
1 parent d1fb114 commit 0bc124b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/controllers/shopify_app/callback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def callback
redirect_to return_address
else
flash[:error] = I18n.t('could_not_log_in')
redirect_to login_url_with_optional_shop
redirect_to(login_url_with_optional_shop)
end
end

Expand Down
24 changes: 14 additions & 10 deletions app/controllers/shopify_app/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def granted_storage_access
def destroy
reset_session
flash[:notice] = I18n.t('.logged_out')
redirect_to login_url_with_optional_shop
redirect_to(login_url_with_optional_shop)
end

private
Expand Down Expand Up @@ -110,7 +110,7 @@ def authenticate_in_context
end

def authenticate_at_top_level
fullpage_redirect_to login_url_with_optional_shop(top_level: true)
fullpage_redirect_to(login_url_with_optional_shop(top_level: true))
end

def authenticate_in_context?
Expand All @@ -128,14 +128,18 @@ def request_storage_access?
end

def redirect_to_request_storage_access
render :request_storage_access, layout: false, locals: {
does_not_have_storage_access_url: top_level_interaction_path(
shop: sanitized_shop_name
),
has_storage_access_url: login_url_with_optional_shop(top_level: true),
app_home_url: granted_storage_access_path(shop: sanitized_shop_name),
current_shopify_domain: current_shopify_domain
}
render(
:request_storage_access,
layout: false,
locals: {
does_not_have_storage_access_url: top_level_interaction_path(
shop: sanitized_shop_name
),
has_storage_access_url: login_url_with_optional_shop(top_level: true),
app_home_url: granted_storage_access_path(shop: sanitized_shop_name),
current_shopify_domain: current_shopify_domain,
}
)
end
end
end
4 changes: 2 additions & 2 deletions lib/shopify_app/controller_concerns/login_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def redirect_to_login
if request.get?
session[:return_to] = "#{request.path}?#{sanitized_params.to_query}"
end
redirect_to login_url_with_optional_shop
redirect_to(login_url_with_optional_shop)
end
end

def close_session
clear_shop_session
redirect_to login_url_with_optional_shop
redirect_to(login_url_with_optional_shop)
end

def clear_shop_session
Expand Down

0 comments on commit 0bc124b

Please sign in to comment.