In config/sanctum.php, add api to guard so it become:
config/sanctum.php
api
guard
'guard' => ['web', 'api'],