Fix empty secret after running fillWithOtpParameters()

This commit is contained in:
Bubka 2022-10-10 13:02:36 +02:00
parent a47975c46e
commit 7c924126a3

View File

@ -374,6 +374,10 @@ class TwoFAccount extends Model implements Sortable
$this->initGenerator();
// The generator could have been initialized without a secret, in that case it generates one on the fly.
// The secret attribute has thus to be updated
$this->secret = $this->secret ?: $this->generator->getSecret();
if ($this->otp_type === self::STEAM_TOTP || strtolower($this->service) === 'steam') {
$this->enforceAsSteam();
}