Class: BlogBasic::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- BlogBasic::SessionsController
- Defined in:
- app/controllers/blog_basic/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/blog_basic/sessions_controller.rb', line 8 def create auth = request.env["omniauth.auth"] #user ||= User.create!(:identifier_url => auth["uid"], # :email => auth["info"]["email"], # :first_name => auth["info"]["first_name"], # :last_name => auth["info"]["last_name"]) #user = User.create_with_omniauth(auth) session[:user_id] = auth["info"]["email"] redirect_to '/', :notice => "Signed in!" end |
#destroy ⇒ Object
19 20 21 22 |
# File 'app/controllers/blog_basic/sessions_controller.rb', line 19 def destroy session[:user_id] = nil redirect_to main_app.root_url, :notice => "Signed out!" end |
#new ⇒ Object
5 6 |
# File 'app/controllers/blog_basic/sessions_controller.rb', line 5 def new end |