Extract auth into Authable base class - #333
Conversation
|
@sanzgrapher please change the contract name |
Match doppar/framework#333 rename from Authenticatable.
|
@sanzgrapher done from your end? |
xentixar
left a comment
There was a problem hiding this comment.
@sanzgrapher hey, looked at the PR. the Authable typing on Auth is good, but we want to push it a bit further.
right now Authable is just an interface and getAuthKeyName() still lives on Model. since Model is generic, auth stuff shouldn’t be there. can you make Authable a base class that extends Model, move the auth methods onto it (getAuthKeyName and the other auth helpers Auth actually uses), and have app models like User extend that instead of implementing a contract?
You are right |
Expand contract with Model-backed props/methods and rewrite Auth @method tags so analysis accepts multi-actor auth models.
Avoid Laravel-homonym; Authable is the Doppar auth-model contract.
Auth models must extend Authable; move auth helpers off Model and drop the dead PHP <7.3 CookieJar path.
b36c66b to
282eac2
Compare
Companion to doppar/framework#333. User implements the contract; auth.php docs note multi-actor models must as well.
Match doppar/framework#333 rename from Authenticatable.
Phaseolies\Auth\Authablebase class extendingModel, with auth helpers (key name, identifier, password, remember token, two-factor)getAuthKeyName()from genericModelAuthfacade +AuthenticateasAuthable; Auth uses those helpers instead of raw auth attributesgetModel()requires anAuthablesubclass; per-actor model check kept for multi-actorextend AuthableCloses #332