You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/controllers/users/base_account_controller.rb

16 lines
343 B

6 years ago
class Users::BaseAccountController < Users::BaseController
5 years ago
before_action :require_login, :check_auth
6 years ago
def observed_user
@_observed_user ||= (User.find_by_id(params[:account_id]) || User.find_by_login(params[:account_id]))
end
private
def require_login
return if User.current.logged?
tip_exception(401, "..")
end
6 years ago
end