Skip to content

Commit

Permalink
Add SignedIn event accessors, to match docs
Browse files Browse the repository at this point in the history
The [library readme](https://github.com/24Slides/laravel-saml2/blob/master/README.md)
gives code examples of handling authentication events,
including `$event->getAuth()` and
`$event->getSame2User()`.

Before this commit, that example code will fail because those
accessors don't exist. This commit adds those accessors
to match the readme code example.
  • Loading branch information
darynmitchell committed Mar 22, 2021
1 parent cb8c4b7 commit e0f93b2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Events/SignedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,26 @@ public function __construct(Saml2User $user, Auth $auth)
$this->user = $user;
$this->auth = $auth;
}

/**
* Get the authentication handler for a SAML sign in attempt
*
* @return Auth The authentication handler for the SignedIn event
*/
public function getAuth(): Auth
{
return $this->auth;
}

/**
* Get the user represented in the SAML sign in attempt
*
* @return Saml2User The user for the SignedIn event
*/
public function getSaml2User(): Saml2User
{
$this->user = $user;
$this->auth = $auth;
return $this->user;
}
}

0 comments on commit e0f93b2

Please sign in to comment.