mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
Updated structure.sql
This commit is contained in:
parent
dadcc9580b
commit
f59c6ee5c3
9 changed files with 96 additions and 6 deletions
26
app/controllers/repp/v1/registrar/auth_controller.rb
Normal file
26
app/controllers/repp/v1/registrar/auth_controller.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Repp
|
||||
module V1
|
||||
module Registrar
|
||||
class AuthController < BaseController
|
||||
api :GET, 'repp/v1/registrar/auth'
|
||||
desc 'check user auth info, track user last login datetime and return data'
|
||||
|
||||
def index
|
||||
registrar = current_user.registrar
|
||||
|
||||
data = set_values_to_data(registrar: registrar)
|
||||
|
||||
render_success(data: data)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_values_to_data(registrar:)
|
||||
data = current_user.as_json(only: %i[id username roles])
|
||||
data[:registrar_name] = registrar.name
|
||||
data
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue