Skip to content

Instantly share code, notes, and snippets.

@tuwukee
Last active November 28, 2018 19:56
Show Gist options
  • Save tuwukee/07a2a59010635f24851b53b51fb03cc4 to your computer and use it in GitHub Desktop.
Save tuwukee/07a2a59010635f24851b53b51fb03cc4 to your computer and use it in GitHub Desktop.
class UsersController < ApplicationController
# ...
before_action :auth_user
# ...
def show
@user = User.find(params[:id])
@customers_portals = UserCustomersPortalsQuery.new(@user).all
end
private
def auth_user
return true if current_user.present?
redirect_to AuthService.sso_url({
callback_url: new_session_url,
original_url: safe_url
})
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment