mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
added api endpoint for registrar login
This commit is contained in:
parent
39b9c94251
commit
6e82d8be9e
2 changed files with 27 additions and 0 deletions
22
app/controllers/repp/v1/registrar/login_controller.rb
Normal file
22
app/controllers/repp/v1/registrar/login_controller.rb
Normal file
|
@ -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
|
|
@ -72,6 +72,11 @@ Rails.application.routes.draw do
|
||||||
get '/all_notifications', to: 'notifications#all_notifications'
|
get '/all_notifications', to: 'notifications#all_notifications'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
resource :login, only: [:index] do
|
||||||
|
collection do
|
||||||
|
get '/', to: 'login#index'
|
||||||
|
end
|
||||||
|
end
|
||||||
resources :nameservers do
|
resources :nameservers do
|
||||||
collection do
|
collection do
|
||||||
put '/', to: 'nameservers#update'
|
put '/', to: 'nameservers#update'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue