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
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Http\Controllers\Auth;
|
---|
4 |
|
---|
5 | use App\Helpers\Alert;
|
---|
6 | use App\Http\Controllers\Controller;
|
---|
7 | use App\Models\User;
|
---|
8 | use Illuminate\Http\Request;
|
---|
9 | use App\Services\Hashid;
|
---|
10 |
|
---|
11 | class 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.