Skip to content

Commit

Permalink
Log logins
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Aug 20, 2020
1 parent 8e2aab9 commit 2968292
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Listeners/Auth/LoginSuccessful.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* http://www.gnu.org/licenses/gpl-2.0.html
*/

use Auth, D2EM;
use Auth, D2EM, Log;
use Entities\UserLoginHistory as UserLoginHistoryEntity;
use Illuminate\Auth\Events\Login as LoginEvent;

Expand All @@ -38,6 +38,8 @@ class LoginSuccessful {
*/
public function handle( LoginEvent $e )
{
Log::notice( 'Login successful for user "' .$e->user->getUsername(). '" from IP ' . ixp_get_client_ip() . '.' );

if( !session()->exists( "switched_user_from" ) && $e->user->getCurrentCustomerToUser() ) {
if( Auth::viaRemember() ) {
$e->user->getCurrentCustomerToUser()->setLastLoginVia( 'RememberMe' );
Expand Down

0 comments on commit 2968292

Please sign in to comment.