Skip to content

Commit 27cefa6

Browse files
authored
Merge pull request #90 from mlibrary/fix-logout
changes logout url to redirect to oauth2/sign_out
2 parents ac7ad37 + 702a358 commit 27cefa6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

get-this.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def set_patron
3434

3535
get "/logout" do
3636
session.clear
37-
redirect "https://shibboleth.umich.edu/cgi-bin/logout?https://lib.umich.edu/"
37+
weblogin_logout_url = URI.encode_www_form_component("https://shibboleth.umich.edu/cgi-bin/logout?https://lib.umich.edu/")
38+
log_out_url = "/oauth2/sign_out?rd=#{weblogin_logout_url}"
39+
redirect log_out_url
3840
end
3941

4042
before do

spec/weblogin_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
end
4545

4646
context "/logout" do
47-
it "clears the session and redirects to shibboleth" do
47+
it "clears the session and redirects to oauth2/sign_out" do
4848
get "/logout"
4949
expect(last_request.env["rack.session"][:uniqname]).to be_nil
50-
expect(last_response.location).to eq("https://shibboleth.umich.edu/cgi-bin/logout?https://lib.umich.edu/")
50+
expect(last_response.location).to include("oauth2/sign_out")
5151
end
5252
end
5353
end

0 commit comments

Comments
 (0)