Skip to content

Commit

Permalink
fix logout test
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Apr 29, 2023
1 parent 616fc9e commit 6d0898a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func TestServerLogout(t *testing.T) {

req := newDefaultHttpRequest("/_oauth/logout")
res, _ := doHttpRequest(req, nil)
require.Equal(401, res.StatusCode, "should return a 401")
require.Equal(307, res.StatusCode, "should return a 307")

// Check for cookie
var cookie *http.Cookie
Expand All @@ -317,8 +317,7 @@ func TestServerLogout(t *testing.T) {
require.Less(cookie.Expires.Local().Unix(), time.Now().Local().Unix()-50, "cookie should have expired")

// Test with redirect
config.LogoutRedirect = "http://example.com/path"
req = newDefaultHttpRequest("/_oauth/logout")
req = newDefaultHttpRequest("/_oauth/logout?redirect=/path")
res, _ = doHttpRequest(req, nil)
require.Equal(307, res.StatusCode, "should return a 307")

Expand Down

0 comments on commit 6d0898a

Please sign in to comment.