Skip to content

Commit

Permalink
[bugfix] Fix admin account confirm on pre-confirmed account setting…
Browse files Browse the repository at this point in the history
… email address to empty string (#1203)
  • Loading branch information
tsmethurst authored Dec 2, 2022
1 parent 34716d7 commit 281f712
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cmd/gotosocial/action/admin/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ var Confirm action.GTSAction = func(ctx context.Context) error {
return err
}

updatingColumns := []string{"approved", "email", "confirmed_at", "updated_at"}
updatingColumns := []string{"approved", "email", "confirmed_at"}
approved := true
u.Approved = &approved
u.Email = u.UnconfirmedEmail
u.ConfirmedAt = time.Now()
u.UpdatedAt = time.Now()
if err := dbConn.UpdateByID(ctx, u, u.ID, updatingColumns...); err != nil {
if err := dbConn.UpdateUser(ctx, u, updatingColumns...); err != nil {
return err
}

Expand Down
1 change: 0 additions & 1 deletion internal/db/bundb/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string,
if emailVerified {
u.ConfirmedAt = time.Now()
u.Email = email
u.UnconfirmedEmail = ""
}

if admin {
Expand Down

0 comments on commit 281f712

Please sign in to comment.