Skip to content

Instantly share code, notes, and snippets.

View ty-porter's full-sized avatar
🚴

Tyler Porter ty-porter

🚴
View GitHub Profile
@ty-porter
ty-porter / api_failure_app.rb
Created February 20, 2020 21:31 — forked from bitwerx-tyler/api_failure_app.rb
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