mirror of
https://github.com/elyby/accounts.git
synced 2024-12-24 06:09:52 +05:30
3b9ef7ea70
Добавлен валидатор для TOTP кодов
18 lines
528 B
PHP
18 lines
528 B
PHP
<?php
|
|
|
|
use console\db\Migration;
|
|
|
|
class m170118_224937_account_otp_secrets extends Migration {
|
|
|
|
public function safeUp() {
|
|
$this->addColumn('{{%accounts}}', 'otp_secret', $this->string()->after('registration_ip'));
|
|
$this->addColumn('{{%accounts}}', 'is_otp_enabled', $this->boolean()->notNull()->defaultValue(false)->after('otp_secret'));
|
|
}
|
|
|
|
public function safeDown() {
|
|
$this->dropColumn('{{%accounts}}', 'otp_secret');
|
|
$this->dropColumn('{{%accounts}}', 'is_otp_enabled');
|
|
}
|
|
|
|
}
|