chore: improve debug logging

This commit is contained in:
kolaente
2025-01-30 17:38:36 +01:00
parent e9444159c5
commit e9d9f04763
2 changed files with 3 additions and 1 deletions

View File

@@ -111,7 +111,6 @@ func HandleCallback(c echo.Context) error {
// Check if the provider exists
providerKey := c.Param("provider")
provider, err := GetProvider(providerKey)
log.Debugf("Provider: %v", provider)
if err != nil {
return handler.HandleHTTPError(err)
}
@@ -119,6 +118,8 @@ func HandleCallback(c echo.Context) error {
return c.JSON(http.StatusBadRequest, models.Message{Message: "Provider does not exist"})
}
log.Debugf("Trying to authenticate user using provider: %s", provider.Key)
provider.Oauth2Config.RedirectURL = cb.RedirectURL
// Parse the access & ID token

View File

@@ -79,6 +79,7 @@ func checkAPITokenAndPutItInContext(tokenHeaderValue string, c echo.Context) err
}
if !models.CanDoAPIRoute(c, token) {
log.Debugf("[auth] Tried authenticating with token %d but it does not have permission to do this route", token.ID)
return echo.NewHTTPError(http.StatusUnauthorized)
}