This PR makes a few changes to the authentication flow & responses:
Updates the canRegister method to check $user and $account values. If either of these are NOT null it returns false, instructing us to attempt to authenticate the existing user.
If we cannot find a user for the email on the provider, we now resolve the user from the connected account model, if one exists for the provider.
Added a new test to ensure users who change their emails can still be logged in with previous providers
Deprecated some response contracts and classes in favour of a more generic OAuthFailed event and OAuthFailedResponse.
Replaces all usages of session() with Session facade
Resolves #350
This PR makes a few changes to the authentication flow & responses:
canRegister
method to check$user
and$account
values. If either of these are NOTnull
it returns false, instructing us to attempt to authenticate the existing user.OAuthFailed
event andOAuthFailedResponse
.session()
withSession
facade