mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 15:46:44 +00:00
feat: remove user from bridge users list if init failed
This commit is contained in:
@ -332,10 +332,10 @@ func (b *Bridge) addNewUser(user *pmapi.User, auth *pmapi.Auth, hashedPassword s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The user needs to be part of the users list in order for it to receive an auth during initialisation.
|
// The user needs to be part of the users list in order for it to receive an auth during initialisation.
|
||||||
// TODO: If adding the user fails, we don't want to leave it there.
|
|
||||||
b.users = append(b.users, bridgeUser)
|
b.users = append(b.users, bridgeUser)
|
||||||
|
|
||||||
if err = bridgeUser.init(b.idleUpdates); err != nil {
|
if err = bridgeUser.init(b.idleUpdates); err != nil {
|
||||||
|
b.users = b.users[:len(b.users)-1]
|
||||||
return errors.Wrap(err, "failed to initialise user")
|
return errors.Wrap(err, "failed to initialise user")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user