From 00f5bc7286a0391c086c46a93912d5ead55076da Mon Sep 17 00:00:00 2001 From: Carlos Dominguez Date: Mon, 29 May 2017 14:48:07 -0400 Subject: [PATCH] Adding missed methods in token_validations_controller.rb --- .../token_validations_controller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/controllers/devise_token_auth/token_validations_controller.rb b/app/controllers/devise_token_auth/token_validations_controller.rb index 7d81a7855..11edcf1e6 100644 --- a/app/controllers/devise_token_auth/token_validations_controller.rb +++ b/app/controllers/devise_token_auth/token_validations_controller.rb @@ -31,5 +31,20 @@ def validate_external_token end end + protected + + def render_validate_token_success + render json: { + success: true, + data: resource_data(resource_json: @resource.token_validation_response) + } + end + + def render_validate_token_error + render json: { + success: false, + errors: [I18n.t("devise_token_auth.token_validations.invalid")] + }, status: 401 + end end end