class Api::V1::ApiController < ::ActionController::API before_action :authenticate_user private def authenticate_user #["current_user","current_token"] Make this true to check for email also @instance_hash = ::Arcadex.full_authentication(params,request,false) if @instance_hash.nil? render :json => {errors: "User is not logged in, register or log in"} , status: :unauthorized end end def current_user if !@instance_hash.nil? @instance_hash["current_user"] end end def current_token if !@instance_hash.nil? @instance_hash["current_token"] end end end