Class: Api::UserController

Inherits:
ActionController::Base
  • Object
show all
Includes:
GDS::SSO::ControllerMethods
Defined in:
app/controllers/api/user_controller.rb

Instance Method Summary collapse

Methods included from GDS::SSO::ControllerMethods

#authenticate_user!, #authorise_user!, #current_user, included, #logout, #user_remotely_signed_out?, #user_signed_in?, #warden

Instance Method Details

#reauthObject



15
16
17
18
19
20
21
22
# File 'app/controllers/api/user_controller.rb', line 15

def reauth
  user = GDS::SSO::Config.user_klass.where(uid: params[:uid]).first
  if user.nil? || user.set_remotely_signed_out!
    head :ok, content_type: "text/plain"
  else
    head 500, content_type: "text/plain"
  end
end

#updateObject



8
9
10
11
12
13
# File 'app/controllers/api/user_controller.rb', line 8

def update
  user_json = JSON.parse(request.body.read)["user"]
  oauth_hash = build_gds_oauth_hash(user_json)
  GDS::SSO::Config.user_klass.find_for_gds_oauth(oauth_hash)
  head :ok, content_type: "text/plain"
end