Skip to content

Commit

Permalink
fixup! add request_id and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azuki774 committed Jul 14, 2024
1 parent db6598a commit ca2924f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (a *Authenticater) GenerateCookie() (*http.Cookie, error) {
Name: "token",
Value: v,
}
slog.Info("generate cookie", "value", v)

err := a.AuthStore.InsertCookieValue(v)
if err != nil {
slog.Error("failed to store new cookie", "err", err)
Expand All @@ -46,7 +46,6 @@ func (a *Authenticater) IsValidCookie(r *http.Request) (ok bool, err error) {
if err != nil {
// unknown error: http: named cookie not present
// token の key がない場合もここに落ちるので、この場合は ok = false とする
slog.Info("undetected cookie: token")
return false, nil
}
v := token.Value
Expand Down
1 change: 1 addition & 0 deletions internal/server/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (s *Server) proxyMain(w http.ResponseWriter, r *http.Request) (resultCode P
return ProxyResultInternalError
}
http.SetCookie(w, cookie)
slog.Info("generate cookie", "request_id", reqId)
}

respBody := []byte("")
Expand Down

0 comments on commit ca2924f

Please sign in to comment.