Skip to content

Commit

Permalink
Merge pull request #19 from vshn/fix-redir
Browse files Browse the repository at this point in the history
Fix redirect after login
  • Loading branch information
ccremer authored Nov 10, 2021
2 parents 90308e9 + 2ea4d9d commit d4788f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/web/session_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (s Server) Login() http.Handler {
HttpOnly: true,
Secure: true,
})
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
http.Redirect(w, r, "/", http.StatusFound)
})
}

Expand Down
4 changes: 2 additions & 2 deletions test/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func TestLoginSuccess(t *testing.T) {
res := httptest.NewRecorder()
newServer(odooMock.URL).ServeHTTP(res, req)

is.Equal(res.Code, http.StatusTemporaryRedirect) // HTTP status
is.Equal(res.Header().Get("Location"), "/") // Location header
is.Equal(res.Code, http.StatusFound) // HTTP status
is.Equal(res.Header().Get("Location"), "/") // Location header

is.Equal(1, len(res.Result().Cookies())) // number of cookies
c := res.Result().Cookies()[0]
Expand Down

0 comments on commit d4788f4

Please sign in to comment.