From 87b503ec799a4201c43b6c60de78177e1524ffe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergei=20Ts=C3=B5ganov?= Date: Tue, 21 Jun 2022 12:40:34 +0300 Subject: [PATCH] Updated tara callback endpoint --- app/controllers/repp/v1/registrar/auth_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/repp/v1/registrar/auth_controller.rb b/app/controllers/repp/v1/registrar/auth_controller.rb index a15230c78..46c21459e 100644 --- a/app/controllers/repp/v1/registrar/auth_controller.rb +++ b/app/controllers/repp/v1/registrar/auth_controller.rb @@ -17,7 +17,8 @@ module Repp desc 'check tara callback omniauth user info and return token' def tara_callback user = ApiUser.from_omniauth(auth_params) - handle_non_epp_errors(user, I18n.t(:no_such_user)) and return unless user && user&.active + response = { code: 401, message: I18n.t(:no_such_user), data: {} } + render(json: response, status: :unauthorized) and return unless user && user&.active token = Base64.urlsafe_encode64("#{user.username}:#{user.plain_text_password}") render_success(data: { token: token, username: user.username })