Skip to content

Instantly share code, notes, and snippets.

View bitwerx-tyler's full-sized avatar

bitwerx-tyler

View GitHub Profile
@bitwerx-tyler
bitwerx-tyler / api_failure_app.rb
Created February 20, 2020 21:28
Custom failure app for devise-jwt to respond in JSON format
# frozen_string_literal: true
module Devise
# Failure application that will be called every time :warden is thrown from
# any strategy or hook. This application overrides the default Devise
# failure application in order to render messages as JSON.
class ApiFailureApp < Devise::FailureApp
def respond
json_api_error_response
end