Skip to content

Commit

Permalink
check password matches
Browse files Browse the repository at this point in the history
  • Loading branch information
xlcrr committed Jul 22, 2023
1 parent 6d86797 commit 81b035d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/Http/Controllers/API/DeleteAccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;

class DeleteAccountController extends Controller
{
Expand All @@ -26,10 +27,19 @@ public function __invoke (Request $request)
{
$user = Auth::guard('api')->user();

$userId = $user->id;

// Check the users password matches
\Log::info($request->all());
if (Hash::check($request->password, $user->password)) {
return [
'check' => true
];
}
else {
return [
'check' => false
];
}

$userId = $user->id;

return [
'test' => true
Expand Down

0 comments on commit 81b035d

Please sign in to comment.