Based on the provided information, it seems like the issue might be related to the authentication guard being used. The admin login is working because it is using the default guard ('web'), but the customer login is using a custom guard ('shopify_customers').
To ensure that the custom guard is being used for customer authentication, make sure to specify the guard in the login form and in the authentication middleware.
In the login form, add a hidden input field with the name 'guard' and value 'shopify_customers':
<form method="POST" action="{{ route('customer.login') }}">
@csrf
<input type="hidden" name="guard" value="shopify_customers">
<!-- rest of the form fields -->
</form>
In the authentication middleware, specify the guard as 'shopify_customers':
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
if ($guard == 'shopify_customers') {
$this->redirectTo = '/customer/dashboard';
}
return $next($request);
}
Also, make sure that the 'shopify_customers' guard is defined in the auth.php config file:
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
'shopify_customers' => [
'driver' => 'session',
'provider' => 'shopify_customers',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
'shopify_customers' => [
'driver' => 'eloquent',
'model' => App\Models\ShopifyCustomer::class,
],
],
Make sure that the 'shopify_customers' provider is also defined in the auth.php config file.
If the issue persists, try debugging the authentication process by adding some logging statements or using the Laravel Debugbar package to inspect the authentication requests and responses.