Two factor authentication (2FA) for Kirby 3 panel

In the company where I work I had the opportunity to make a plugin that allows two-factor authentication.

Visit the plugin repository.


All comments, critics and suggestions are welcome.

5 Likes

2fa_1

Was following instructions written in plugin repository, but was not able to implement…
Kirby 3.6.0 / PHP 8.0.18

Added function in config and db.sqlite is created on first login attempt under /content/storage

2fa_2
Also added field entry in user blueprint, but in panel under user account got this…

Looks like plugin is not maintained anymore (last commit in 2020) and nobody is using it as there are no discussions regarding this? Its a bit strange, because 2FA is so important in nowdays…
Unfortunatelly Kirbys own 2FA with code challenge via email sending is not convenient and server is not allways sending it…

Heya

I had the same problems!
But I seem to have fixed it:
this is the index.js from the plugin

also /kirby-2fa/src/models/Register.php needs to be changed for correct setting of the sqlite db:

$this->db->createTable($this->table, [
    'user_id' => [
        'type' => 'varchar',
    ],
    'secret' => [
        'type' => 'varchar',
    ],
    'created_at' => [
        'type' => 'timestamp',
    ],
]);

(note: I’m not a vue / kirby panel developer, so this is just how I got it working)

Hey @gork thanks so much for this! Works perfect in 3.8.2. Would you consider opening a pull request on the original repo so we can hopefully get it updated for everyone?

Heya @sammularczyk
As this is quite a crude and dirty fix, I’d rather not - I don’t really understand what lines 83-85 were meant to do and this is how I got around it. My guess is, it shouldn’t be just $this.go("/") to be honest :see_no_evil: