Module: Aadhar::Authenticate

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
lib/aadhar/authenticate.rb

Instance Method Summary collapse

Instance Method Details

#authenticateObject



5
6
7
# File 'lib/aadhar/authenticate.rb', line 5

def authenticate
	render :status => 401, :json => { :success => false, :info => "Unauthorized"} if !current_user.present?
end

#current_userObject



9
10
11
# File 'lib/aadhar/authenticate.rb', line 9

def current_user
    @current_user ||= User.where(authentication_token: params[:auth_token]).first
end