Last active
November 28, 2018 19:56
-
-
Save tuwukee/07a2a59010635f24851b53b51fb03cc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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