Skip to content

Commit 1d7370b

Browse files
authored
fix: fixing dynamic user class (#526)
* fix: fixing dynamic user class * Fix styling --------- Co-authored-by: binaryk <[email protected]>
1 parent 800a7a4 commit 1d7370b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Http/Controllers/Auth/VerifyController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
namespace Binaryk\LaravelRestify\Http\Controllers\Auth;
44

55
use Binaryk\LaravelRestify\Contracts\Sanctumable;
6-
use Binaryk\LaravelRestify\Tests\Fixtures\User\User;
76
use Illuminate\Auth\Access\AuthorizationException;
87
use Illuminate\Auth\Events\Verified;
8+
use Illuminate\Contracts\Auth\Authenticatable;
99
use Illuminate\Contracts\Auth\MustVerifyEmail;
1010
use Illuminate\Routing\Controller;
1111

1212
class VerifyController extends Controller
1313
{
1414
public function __invoke(int $id, string $hash)
1515
{
16-
$user = User::query()->findOrFail($id);
16+
/**
17+
* @var Authenticatable $user
18+
*/
19+
$user = config('restify.auth.user_model')::query()->findOrFail($id);
1720

1821
if ($user instanceof Sanctumable && ! hash_equals((string) $hash, sha1($user->getEmailForVerification()))) {
1922
throw new AuthorizationException('Invalid hash');

0 commit comments

Comments
 (0)