Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoginAttempt.php:11 #107

Closed
neokofg opened this issue Jun 26, 2023 · 3 comments
Closed

LoginAttempt.php:11 #107

neokofg opened this issue Jun 26, 2023 · 3 comments

Comments

@neokofg
Copy link

neokofg commented Jun 26, 2023

Error: Cannot use object of type Illuminate\Auth\Events\Attempting as array in projectname/vendor/genealabs/laravel-mixpanel/src/Listeners/LoginAttempt.php:11

$email = $event->credentials['email'] ?? $event['email'] ?? '';
i think it should be like this
$email = $event->credentials['email'] ?? '';

@mikebronner
Copy link
Owner

@neokofg thank you for writing in. Could you submit a test repo with the failure, or alternatively create a phpunit test with the failure as a PR?

@bajarang-agarwal
Copy link

@mikebronner

We are also getting the same error.

In LoginAttempt.php, we printed the following line

\Log::info($event->credentials);

it printed as:

array (
'code' => 'cJ8U-3kn9FUnup05opsNYgL8_xeQcYarwL9kMjlS3gg',
'state' => '6aef979c21f2ab6ff80b85cde466d6',
)

If you notice this does not have email in the credentials object.
On a side note, we are using Auth0 and Auth0 does not return the email so it might be an issue.

@mikebronner
Copy link
Owner

This should be fixed in release 11.0.1. Please open a new ticket with a complete stack trace if it still is erroring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants