Module: JwtAuthentication

Defined in:
lib/jwt_auth/jwt_authentication.rb

Instance Method Summary collapse

Instance Method Details

#show_authentication_messagesObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/jwt_auth/jwt_authentication.rb', line 29

def show_authentication_messages
  respond_to do |format|
    format.html{super}
    format.json{
      Devise.mappings.keys.collect(&:to_s).each do |u|
        return render(:json=> eval("@#{u}.errors"), :status=>422) if eval("@#{u} && @#{u}.errors.any?")
      end
      render :json=>{:success=>true}, :status=>201
    }
  end
end

#unauthorized!Object



42
43
44
# File 'lib/jwt_auth/jwt_authentication.rb', line 42

def unauthorized!
  head :unauthorized
end