diff --git a/app/controllers/repp/v1/registrar/login_controller.rb b/app/controllers/repp/v1/registrar/login_controller.rb new file mode 100644 index 000000000..501c6129c --- /dev/null +++ b/app/controllers/repp/v1/registrar/login_controller.rb @@ -0,0 +1,22 @@ +module Repp + module V1 + module Registrar + class LoginController < BaseController + api :GET, 'repp/v1/registrar/login' + desc 'check login user and return data' + + def index + @login = current_user + + # rubocop:disable Style/AndOr + render_success(data: nil) and return unless @login + # rubocop:enable Style/AndOr + + data = @login.as_json() + + render_success(data: data) + end + end + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 1a3b394d1..a7f9b4302 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,6 +72,11 @@ Rails.application.routes.draw do get '/all_notifications', to: 'notifications#all_notifications' end end + resource :login, only: [:index] do + collection do + get '/', to: 'login#index' + end + end resources :nameservers do collection do put '/', to: 'nameservers#update'