The "sign out" button now clears the Launchpad login.
ref: https://fizzy.37signals.com/5986089/collections/2/cards/1382
This commit is contained in:
@@ -17,7 +17,7 @@ class SessionsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
terminate_session
|
||||
redirect_to_login_url
|
||||
redirect_to_logout_url
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -11,7 +11,19 @@ module LoginHelper
|
||||
end
|
||||
end
|
||||
|
||||
def logout_url
|
||||
if Rails.application.config.x.local_authentication
|
||||
new_session_path
|
||||
else
|
||||
Launchpad.logout_url
|
||||
end
|
||||
end
|
||||
|
||||
def redirect_to_login_url
|
||||
redirect_to login_url, allow_other_host: true
|
||||
end
|
||||
|
||||
def redirect_to_logout_url
|
||||
redirect_to logout_url, allow_other_host: true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,10 @@ module Launchpad
|
||||
url product_account_path("/signin", product: product, account: account), params
|
||||
end
|
||||
|
||||
def logout_url
|
||||
url "/signout"
|
||||
end
|
||||
|
||||
def authentication_url(**params)
|
||||
url "/authenticate", params.merge(product: :fizzy)
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
delete session_path
|
||||
|
||||
assert_redirected_to Launchpad.login_url(account: Account.sole)
|
||||
assert_redirected_to Launchpad.logout_url
|
||||
assert_not cookies[:session_token].present?
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user