Logout redirects back to root_path
This commit is contained in:
@@ -22,7 +22,12 @@ class SessionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@session.destroy; redirect_to(sessions_path, notice: "That session has been logged out")
|
@session.destroy
|
||||||
|
if Current.session == @session
|
||||||
|
redirect_to(root_path, notice: "You are logged out")
|
||||||
|
else
|
||||||
|
redirect_to(sessions_path, notice: "That session has been logged out")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user