mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-17 05:52:13 +09:00
feat: Add audit logging (#38189)
Co-authored-by: bircni <bircni@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -8,10 +8,12 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
audit_model "gitea.dev/models/audit"
|
||||
issues_model "gitea.dev/models/issues"
|
||||
repo_model "gitea.dev/models/repo"
|
||||
user_model "gitea.dev/models/user"
|
||||
"gitea.dev/modules/structs"
|
||||
"gitea.dev/services/audit"
|
||||
|
||||
"github.com/markbates/goth"
|
||||
)
|
||||
@@ -46,6 +48,9 @@ func LinkAccountToUser(ctx context.Context, authSourceID int64, user *user_model
|
||||
return err
|
||||
}
|
||||
|
||||
audit.RecordAs(ctx, user, audit_model.UserExternalLoginAdd, user,
|
||||
"external_id", externalLoginUser.ExternalID, "provider", externalLoginUser.Provider)
|
||||
|
||||
externalID := externalLoginUser.ExternalID
|
||||
|
||||
var tp structs.GitServiceType
|
||||
|
||||
Reference in New Issue
Block a user