Override registration and session render methods
to remove wrapping data-element
This commit is contained in:
parent
f223c03686
commit
417b296d0e
|
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Overrides
|
||||||
|
class RegistrationsController < DeviseTokenAuth::RegistrationsController
|
||||||
|
def render_create_success
|
||||||
|
render json: resource_data
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_update_success
|
||||||
|
render json: resource_data
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Overrides
|
||||||
|
class SessionsController < DeviseTokenAuth::SessionsController
|
||||||
|
def render_create_success
|
||||||
|
render json: resource_data(resource_json: @resource.token_validation_response)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
mount_devise_token_auth_for 'User', at: 'users'
|
mount_devise_token_auth_for 'User', at: 'users', controllers: {
|
||||||
|
registrations: 'overrides/registrations',
|
||||||
|
sessions: 'overrides/sessions'
|
||||||
|
}
|
||||||
|
|
||||||
resources :matches, only: %i[show]
|
resources :matches, only: %i[show]
|
||||||
resources :teams, only: %i[show update]
|
resources :teams, only: %i[show update]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue