Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion manager/middlewares/personal_access_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func PersonalAccessToken(gdb *gorm.DB) gin.HandlerFunc {
return
}

// Set the personal access token in the context for audit purposes.
c.Set("pat", &token)

// Check if the token is active.
if token.State != models.PersonalAccessTokenStateActive {
logger.Errorf("inactive token used: %s, token name: %s, user_id: %d", c.Request.URL.Path, token.Name, token.UserID)
Expand Down Expand Up @@ -111,7 +114,6 @@ func PersonalAccessToken(gdb *gorm.DB) gin.HandlerFunc {
return
}

c.Set("pat", &token)
c.Next()
}
}
Expand Down
Loading