Last change
on this file 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 |
|
---|
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 App\Notifications\VerifyUser;
|
---|
9 | use Illuminate\Http\Request;
|
---|
10 | use App\Services\Hashid;
|
---|
11 | use Illuminate\Support\Carbon;
|
---|
12 |
|
---|
13 | class 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.