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