laravel-authentication-log icon indicating copy to clipboard operation
laravel-authentication-log copied to clipboard

Fix log creation in the LogoutListener to use correct class

Open jimwins opened this issue 10 months ago • 2 comments

It is possible to use a custom AuthenticationLog by overriding the authentications() and latestAuthentication() methods from the AuthenticationLoggable trait, except for this listener which tries creates a new AuthenticationLog directly. By going through the User model, we will create an object of the correct (custom) class.

This fixes the specific problem of a custom AuthenticationLog model that uses the \Illuminate\Database\Eloquent\Concerns \hasUlids trait not being successfully created here because it fails to generate the id.

jimwins avatar Feb 01 '25 21:02 jimwins

Related to #108.

jimwins avatar Feb 01 '25 21:02 jimwins

Rebased to develop for merging this weekend

lrljoe avatar Mar 01 '25 00:03 lrljoe