Last change
on this file since 0a1fb54 was 0a1fb54, checked in by beratkjufliju <kufliju@…>, 3 years ago |
bug fixes
|
-
Property mode
set to
100644
|
File size:
771 bytes
|
Rev | Line | |
---|
[1c25bcf] | 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;
|
---|
[0a1fb54] | 8 | use App\Notifications\VerifyUser;
|
---|
[1c25bcf] | 9 | use Illuminate\Http\Request;
|
---|
| 10 | use App\Services\Hashid;
|
---|
[0a1fb54] | 11 | use Illuminate\Support\Carbon;
|
---|
[1c25bcf] | 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.