Class: AuthicClient::SessionsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- AuthicClient::SessionsController
show all
- Defined in:
- app/controllers/authic_client/sessions_controller.rb
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
|
# File 'app/controllers/authic_client/sessions_controller.rb', line 2
def create
user = User.find_for_authic_oauth(request.env["omniauth.auth"], current_user)
if user.persisted?
session[:authic_user_id] = user.id
redirect_path ||= session[:authic_return_to_this_url] ||= root_url
session[:authic_return_to_this_url] = nil
redirect_to redirect_path, :notice => "You have been successfully signed in"
else
redirect_to root_url
end
end
|
#destroy ⇒ Object
15
16
17
18
19
|
# File 'app/controllers/authic_client/sessions_controller.rb', line 15
def destroy
reset_session
redirect_path = "#{AuthicClient::ApplicationHelper::AUTHIC_CLIENT_FULL_URL}/authic_sign_out?&return_path=#{URI.escape root_url}"
redirect_to redirect_path
end
|