mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 21:46:24 +02:00
Updated tara callback endpoint
This commit is contained in:
parent
f8ef0502a5
commit
87b503ec79
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,8 @@ module Repp
|
||||||
desc 'check tara callback omniauth user info and return token'
|
desc 'check tara callback omniauth user info and return token'
|
||||||
def tara_callback
|
def tara_callback
|
||||||
user = ApiUser.from_omniauth(auth_params)
|
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}")
|
token = Base64.urlsafe_encode64("#{user.username}:#{user.plain_text_password}")
|
||||||
render_success(data: { token: token, username: user.username })
|
render_success(data: { token: token, username: user.username })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue