mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-18 02:12:30 +08:00
Started barebones work of MFA system
This commit is contained in:
29
app/Http/Controllers/Auth/MfaController.php
Normal file
29
app/Http/Controllers/Auth/MfaController.php
Normal 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user