ResetPasswordController::__invoke()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 0
cp 0
rs 10
cc 3
nc 2
nop 1
crap 12
1
<?php
2
3
namespace App\Http\Controllers\Auth;
4
5
use Inertia\Inertia;
6
7
use Illuminate\Http\Request;
8
9
use App\Http\Controllers\Controller;
10
11
class ResetPasswordController extends Controller
12
{
13
    /**
14
     *  For users with reset token to allow user to reset their password
15
     */
16
    public function __invoke(Request $request)
17
    {
18
        // If the user is trying to visit the page without a token or email address, show 404 error
19
        if(empty($request->token) || empty($request->email))
20
        {
21
            abort(404);
22
        }
23
24
        return Inertia::render('Auth/password/reset', [
25
            'token' => $request->token,
26
            'email' => $request->email,
27
        ]);
28
    }
29
}
30