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

Use getAuthIdentifier instead of getKey for compatibility with other Laravel auth providers #283

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

stevebauman
Copy link
Contributor

@stevebauman stevebauman commented Sep 30, 2020

Purpose:

This PR provides further support for other authentication providers in Jetstream.

Reason:

Since the getKey() method is not apart of the Authenticatable contract, anyone attempting to use the Inertia stack in Jetstream with another authentication provider cannot do so if the authenticatable user does not implement the getKey() method.

Details:

It would be great to use the getAuthIdentifier() method instead of getKey() since the former is implemented in the Authenticatable contract when using other authentication providers in Jetstream.

Breaking Changes:

There are no breaking changes in this PR. The getAuthIdentifier() method uses the id database column by default on the included App\Models\User model. Anyone who has adjusted or modified their primary user key will also be compatible with this change, due to the Illuminate\Auth\Authenticatable trait retrieving the key name dynamically from the model's $primaryKey property.

If there are any questions or concerns please let me know! 👍 ❤️

This provides the ability to use other authentication providers with Jetstream (Inertia), since this method is required to be implemented via the Authenticatable contract.
@taylorotwell taylorotwell merged commit 3fe2c01 into laravel:1.x Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants