mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
move oauth models into gtsmodel
This commit is contained in:
@@ -27,7 +27,6 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/messages"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// Delete handles the complete deletion of an account.
|
||||
@@ -66,12 +65,12 @@ func (p *processor) Delete(ctx context.Context, account *gtsmodel.Account, origi
|
||||
u := >smodel.User{}
|
||||
if err := p.db.GetWhere(ctx, []db.Where{{Key: "account_id", Value: account.ID}}, u); err == nil {
|
||||
// we got one! select all tokens with the user's ID
|
||||
tokens := []*oauth.Token{}
|
||||
tokens := []*gtsmodel.Token{}
|
||||
if err := p.db.GetWhere(ctx, []db.Where{{Key: "user_id", Value: u.ID}}, &tokens); err == nil {
|
||||
// we have some tokens to delete
|
||||
for _, t := range tokens {
|
||||
// delete client(s) associated with this token
|
||||
if err := p.db.DeleteByID(ctx, t.ClientID, &oauth.Client{}); err != nil {
|
||||
if err := p.db.DeleteByID(ctx, t.ClientID, >smodel.Client{}); err != nil {
|
||||
l.Errorf("error deleting oauth client: %s", err)
|
||||
}
|
||||
// delete application(s) associated with this token
|
||||
|
Reference in New Issue
Block a user