source: app/Http/Controllers/Auth/VerifyLoginController.php@ dbc5976

Last change on this file since dbc5976 was 0a1fb54, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

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