I’m running into an issue with my Auth0 configuration on PHP Laravel. We’re using Laravel Nova along with Auth0 to provide SSO for our internal users. We’re using the standard auth0-provider
along with a custom UserRepository
implementation as outlined in the tutorials. With this configuration, we are prevented from also setting a model
on our custom auth0-provider
, which breaks a functionality in Nova where the following code is used:
/**
* Get the user model for Laravel Nova.
*
* @return class-string<\Illuminate\Database\Eloquent\Model>
*/
public static function userModel()
{
$guard = config('nova.guard') ?: config('auth.defaults.guard');
$provider = config("auth.guards.{$guard}.provider");
return config("auth.providers.{$provider}.model");
}
This code specifically looks for the auth model on the given provider, which is null because we are not able to set a model when the repository is in use. Obviously we need the repository in order to query for the user in our database. The error is outlined in the following comment: Laravel Nova 4 + Auth0 · GitHub
The error is as follows: Cannot assign App\Models\User to property Auth0\Laravel\Auth\User\Provider::$repository of type ?Auth0\Laravel\Contract\Auth\User\Repository
It seems as though this previously was not an issue and is now an issue due to some updates to the Auth0 SDK. Is there any way we can work around this or get this issue resolved in the next release?