]> BookStack Code Mirror - bookstack/blob - app/Http/Controllers/Auth/MfaController.php
Started barebones work of MFA system
[bookstack] / app / Http / Controllers / Auth / MfaController.php
1 <?php
2
3 namespace BookStack\Http\Controllers\Auth;
4
5 use BookStack\Http\Controllers\Controller;
6 use Illuminate\Http\Request;
7
8 class MfaController extends Controller
9 {
10     /**
11      * Show the view to setup MFA for the current user.
12      */
13     public function setup()
14     {
15         // TODO - Redirect back to profile/edit if already setup?
16         // Show MFA setup route
17         return view('mfa.setup');
18     }
19
20     public function generateQr()
21     {
22         // https://github.com/antonioribeiro/google2fa#how-to-generate-and-use-two-factor-authentication
23
24         // Generate secret key
25         // Store key in session?
26         // Get user to verify setup via responding once.
27         // If correct response, Save key against user
28     }
29 }