Skip to content

Commit 1dfd146

Browse files
committed
error log for oauth
1 parent b61f283 commit 1dfd146

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

internal/handler/auth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"crypto/rand"
66
"encoding/hex"
77
"encoding/json"
8+
"log/slog"
89
"net/http"
910
"time"
1011

@@ -107,6 +108,7 @@ func (h *Handler) GoogleCallback(w http.ResponseWriter, r *http.Request) {
107108
redirectURL := h.getOAuthRedirectURL(r, h.Config.OAuth.Google.RedirectURL)
108109
userInfo, err := h.googleAuth.ExchangeCode(r.Context(), code, redirectURL)
109110
if err != nil {
111+
slog.Error("oauth exchange failed", "err", err, "redirect_uri", redirectURL, "host", r.Host, "xfh", r.Header.Get("X-Forwarded-Host"), "xfp", r.Header.Get("X-Forwarded-Proto"))
110112
h.respondError(w, http.StatusInternalServerError, "Failed to exchange code")
111113
return
112114
}

server

-30.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)