[bugfix] Fix `admin account confirm` on pre-confirmed account setting email address to empty string (#1203)
This commit is contained in:
parent
34716d7d7d
commit
281f712477
|
@ -111,13 +111,12 @@ var Confirm action.GTSAction = func(ctx context.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
updatingColumns := []string{"approved", "email", "confirmed_at", "updated_at"}
|
updatingColumns := []string{"approved", "email", "confirmed_at"}
|
||||||
approved := true
|
approved := true
|
||||||
u.Approved = &approved
|
u.Approved = &approved
|
||||||
u.Email = u.UnconfirmedEmail
|
u.Email = u.UnconfirmedEmail
|
||||||
u.ConfirmedAt = time.Now()
|
u.ConfirmedAt = time.Now()
|
||||||
u.UpdatedAt = time.Now()
|
if err := dbConn.UpdateUser(ctx, u, updatingColumns...); err != nil {
|
||||||
if err := dbConn.UpdateByID(ctx, u, u.ID, updatingColumns...); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,6 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string,
|
||||||
if emailVerified {
|
if emailVerified {
|
||||||
u.ConfirmedAt = time.Now()
|
u.ConfirmedAt = time.Now()
|
||||||
u.Email = email
|
u.Email = email
|
||||||
u.UnconfirmedEmail = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if admin {
|
if admin {
|
||||||
|
|
Loading…
Reference in New Issue