From 440ada3c5f538a51d3d1284c3d6f183f0a004cfc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 17 Jun 2020 10:27:03 +0200 Subject: [PATCH] [Security] Add attributes on Passport --- .../Http/Authenticator/Passport/Passport.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php index a4ead01d14cd2..1e3752d0f25f7 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php +++ b/src/Symfony/Component/Security/Http/Authenticator/Passport/Passport.php @@ -28,9 +28,11 @@ class Passport implements UserPassportInterface protected $user; + private $attributes = []; + /** * @param CredentialsInterface $credentials the credentials to check for this authentication, use - * SelfValidatingPassport if no credentials should be checked. + * SelfValidatingPassport if no credentials should be checked * @param BadgeInterface[] $badges */ public function __construct(UserInterface $user, CredentialsInterface $credentials, array $badges = []) @@ -47,4 +49,22 @@ public function getUser(): UserInterface { return $this->user; } + + /** + * @param mixed $value + */ + public function setAttribute(string $name, $value): void + { + $this->attributes[$name] = $value; + } + + /** + * @param mixed $default + * + * @return mixed + */ + public function getAttribute(string $name, $default = null) + { + return $this->attributes[$name] ?? $default; + } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy