cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

Dropped return type for getUserId in order to support UUIDs #529

Open Milannv opened 4 years ago

Milannv commented 4 years ago

I came across this issue because I setup a custom model to serve as user model and by using UUIDs instead of numeric IDs.

The user model extends Cartalyst\Sentinel\Users\EloquentUser. The implemented interface, Cartalyst\Sentinel\Users\UserInterface, defines a return type.

This method can't be overridden by extending this interface. Using my custom model and creating an interface of my own (obviously) results in Sentinel becoming unusable because it expects the user model to be of type Cartalyst\Sentinel\Users\UserInterface.

brunogaspar commented 4 years ago

Hi @Milannv

While it's a bugfix for your use case, i don't think we can do this change on v4, this is a breaking change unfortunately.