Class: Kuroko2::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kuroko2/sessions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/kuroko2/sessions_controller.rb', line 8

def create
  return_to = params[:state]
  reset_session

  unless valid_google_hosted_domain?
    render :invalid_hd, status: 403, layout: false
    return
  end

  self.current_user = Kuroko2::User.find_or_create_user(auth_hash[:uid], auth_hash[:info])

  unless Kuroko2::ReturnToValidator.valid?(return_to)
    return_to = root_path
  end
  redirect_to return_to
end

#destroyObject



25
26
27
28
29
# File 'app/controllers/kuroko2/sessions_controller.rb', line 25

def destroy
  reset_session

  redirect_to 
end

#newObject



4
5
6
# File 'app/controllers/kuroko2/sessions_controller.rb', line 4

def new
  render layout: false
end