mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 14:53:34 +01:00
remove federated user in case of user deletion
This commit is contained in:
parent
5edf7d0e61
commit
7a142c876e
2 changed files with 12 additions and 0 deletions
|
@ -76,3 +76,8 @@ func FindFederatedUser(ctx context.Context, externalID string,
|
||||||
}
|
}
|
||||||
return user, federatedUser, nil
|
return user, federatedUser, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DeleteFederatedUser(ctx context.Context, userID int64) error {
|
||||||
|
_, err := db.GetEngine(ctx).Delete(&FederatedUser{UserID: userID})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
|
@ -208,6 +208,13 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete Federated Users
|
||||||
|
if setting.Federation.Enabled {
|
||||||
|
if err := user_model.DeleteFederatedUser(ctx, u.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, committer, err := db.TxContext(ctx)
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
|
|
Loading…
Reference in a new issue