summaryrefslogtreecommitdiff
path: root/app/controllers/sessions_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r--app/controllers/sessions_controller.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 8a9de56..68cb949 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -3,23 +3,20 @@ class SessionsController < ApplicationController
def new
end
+ # find the user and create a new session
def create
user = User.find_by(email: params[:session][:email].downcase)
if user && user.authenticate(params[:session][:password])
sign_in user
- #redirect goes here
+ redirect_to root_path
else
render 'new'
end
end
def destroy
-
sign_out
-
- #I dont know where to redirect to so yeah
- # redirect_to sign_in
-
+ redirect_to root_path
end
end