mirror of
https://github.com/writeas/writefreely
synced 2025-01-07 13:31:43 +01:00
Clean up oauth_users table on account deletion
Ref T319
This commit is contained in:
parent
c9faff178d
commit
af14bcbb78
10
database.go
10
database.go
@ -2217,6 +2217,16 @@ func (db *datastore) DeleteAccount(userID int64) error {
|
|||||||
rs, _ = res.RowsAffected()
|
rs, _ = res.RowsAffected()
|
||||||
log.Info("Deleted %d from accesstokens", rs)
|
log.Info("Deleted %d from accesstokens", rs)
|
||||||
|
|
||||||
|
// Delete user attributes
|
||||||
|
res, err = t.Exec("DELETE FROM oauth_users WHERE user_id = ?", userID)
|
||||||
|
if err != nil {
|
||||||
|
t.Rollback()
|
||||||
|
log.Error("Unable to delete oauth_users: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
rs, _ = res.RowsAffected()
|
||||||
|
log.Info("Deleted %d from oauth_users", rs)
|
||||||
|
|
||||||
// Delete posts
|
// Delete posts
|
||||||
// TODO: should maybe get each row so we can federate a delete
|
// TODO: should maybe get each row so we can federate a delete
|
||||||
// if so needs to be outside of transaction like collections
|
// if so needs to be outside of transaction like collections
|
||||||
|
Loading…
Reference in New Issue
Block a user