| @@ 33-39 (lines=7) @@ | ||
| 30 | * @param Psr\Log\LoggerInterface $logger PSR-3 compatible logger |
|
| 31 | * @param int $hashCost Optional value for setting the cost of hashing algorythm (default: 12) |
|
| 32 | */ |
|
| 33 | public function __construct(Repository $repository, DataMapper $accountMapper, LoggerInterface $logger, $hashCost = self::DEFAULT_HASH_COST) |
|
| 34 | { |
|
| 35 | $this->repository = $repository; |
|
| 36 | $this->accountMapper = $accountMapper; |
|
| 37 | $this->logger = $logger; |
|
| 38 | $this->hashCost = $hashCost; |
|
| 39 | } |
|
| 40 | ||
| 41 | ||
| 42 | /** |
|
| @@ 36-47 (lines=12) @@ | ||
| 33 | * @param int $cookieLifespan Lifespan of the authentication cookie in seconds (default: 4 hours) |
|
| 34 | * @param int $hashCost Cost of the bcrypt hashing function (default: 12) |
|
| 35 | */ |
|
| 36 | public function __construct( |
|
| 37 | Repository $repository, |
|
| 38 | LoggerInterface $logger, |
|
| 39 | int $cookieLifespan = self::DEFAULT_COOKIE_LIFESPAN, |
|
| 40 | int $hashCost = self::DEFAULT_HASH_COST |
|
| 41 | ) |
|
| 42 | { |
|
| 43 | $this->repository = $repository; |
|
| 44 | $this->logger = $logger; |
|
| 45 | $this->cookieLifespan = $cookieLifespan; |
|
| 46 | $this->hashCost = $hashCost; |
|
| 47 | } |
|
| 48 | ||
| 49 | ||
| 50 | public function loginWithPassword(Entity\StandardIdentity $identity, string $password): Entity\CookieIdentity |
|