mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-28 10:28:33 -05:00
chore: improve debug logging
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user