app/controllers/api/v1/application_controller.rb
# some actions are allowed for users only
some actions are allowed for users only
some actions are allowed for users only
def authenticate_user!
        payload = decode_token
        return unless payload.is_a? Hash
        @current_user = User.find payload[:user_id]
      end
def authenticate_user! payload = decode_token return unless payload . is_a? Hash @current_user = User . find payload [ :user_id ] end
some actions are allowed for users only
some actions are allowed for users only