Started barebones work of MFA system

This commit is contained in:
Dan Brown
2021-06-28 22:02:45 +01:00
parent ca8be9af3c
commit efb6a6b457
5 changed files with 269 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace BookStack\Http\Controllers\Auth;
use BookStack\Http\Controllers\Controller;
use Illuminate\Http\Request;
class MfaController extends Controller
{
/**
* Show the view to setup MFA for the current user.
*/
public function setup()
{
// TODO - Redirect back to profile/edit if already setup?
// Show MFA setup route
return view('mfa.setup');
}
public function generateQr()
{
// https://github.com/antonioribeiro/google2fa#how-to-generate-and-use-two-factor-authentication
// Generate secret key
// Store key in session?
// Get user to verify setup via responding once.
// If correct response, Save key against user
}
}