Log OIDC code exchange error

This commit is contained in:
Evan Goode 2025-04-12 10:36:32 -04:00
parent e82e6f7117
commit 52a7df7a1b

View File

@ -16,6 +16,7 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"html/template" "html/template"
"io" "io"
"log"
"net/http" "net/http"
"net/url" "net/url"
"path" "path"
@ -756,6 +757,7 @@ func FrontOIDCCallback(app *App) func(c echo.Context) error {
} }
tokens, err := rp.CodeExchange[*oidc.IDTokenClaims](context.Background(), c.FormValue("code"), oidcProvider.RelyingParty, opts...) tokens, err := rp.CodeExchange[*oidc.IDTokenClaims](context.Background(), c.FormValue("code"), oidcProvider.RelyingParty, opts...)
if err != nil { if err != nil {
log.Printf("OIDC code exchange failed with provider %s: %s", oidcProvider.Config.Name, err)
return NewWebError(failureURL, "OIDC code exchange failed.") return NewWebError(failureURL, "OIDC code exchange failed.")
} }