Commit Graph

5 Commits (0ea8de2d0729e1e1d0ea9de1e59fbcb673e87fd2)

Author SHA1 Message Date
KN4CK3R 688d4a1f71
Unify password changing and invalidate auth tokens ()
- Unify the password changing code
- Invalidate existing auth tokens when changing passwords
Lunny Xiao 70c4aad8e1
Move more functions to db.Find ()
Following 

This PR move more functions to use `db.Find`.

---------

Co-authored-by: delvh <dev.lh@web.de>
delvh 778ad795fd
Refactor deletion ()
Introduce the new generic deletion methods
- `func DeleteByID[T any](ctx context.Context, id int64) (int64, error)`
- `func DeleteByIDs[T any](ctx context.Context, ids ...int64) error`
- `func Delete[T any](ctx context.Context, opts FindOptions) (int64,
error)`

So, we no longer need any specific deletion method and can just use
the generic ones instead.

Replacement of 

Closes 

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Earl Warren 59f9ef9fee
Remove action runners on user deletion ()
- On user deletion, delete action runners that the user has created.
- Add a database consistency check to remove action runners that have
nonexistent belonging owner.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1720

(cherry picked from commit 009ca7223dab054f7f760b7ccae69e745eebfabb)

Co-authored-by: Gusted <postmaster@gusted.xyz>
Lunny Xiao f2772b5920
Move delete user to service ()
Move delete user to service

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Jason Song <i@wolfogre.com>