source: app/Http/Controllers/Auth/VerifyLoginController.php@ 4d73966

Last change on this file since 4d73966 was 1c25bcf, checked in by Berat Kjufliju <kufliju@…>, 3 years ago

added 2fa, bug fixes, edited blades

  • Property mode set to 100644
File size: 706 bytes
RevLine 
[1c25bcf]1<?php
2
3namespace App\Http\Controllers\Auth;
4
5use App\Helpers\Alert;
6use App\Http\Controllers\Controller;
7use App\Models\User;
8use Illuminate\Http\Request;
9use App\Services\Hashid;
10
11class VerifyLoginController extends Controller
12{
13 public function index()
14 {
15 return view("auth.verify-login");
16 }
17
18 public function verify(Request $request, Hashid $hashid, $id, $token)
19 {
20 $user = User::findOrFail($hashid->decode($id));
21
22 if($request->code != $user->security_code) {
23 Alert::flash("Security code is wrong", "error");
24 return redirect()->back();
25 }
26
27 auth()->login($user);
28
29 return redirect()->route("dashboard.index");
30 }
31}
Note: See TracBrowser for help on using the repository browser.