Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d17b276 authored by Ronak Patel's avatar Ronak Patel
Browse files

change in argument

parent af29b8ef
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 	}
 
-	public function create(IUser $user, string $subject, string $passwordPrefix = ''): string {
+	public function create(IUser $user, string $subject, string $passwordPrefix = '', int $expirationTime = self::TOKEN_LIFETIME): string {
+	public function create(IUser $user, string $subject, string $passwordPrefix = '', int $expirationTime = self::TOKEN_LIFETIME * 2): string {
 		$token = $this->secureRandom->generate(
 			21,
 			ISecureRandom::CHAR_DIGITS.
@@ -14,7 +14,7 @@
 			'subject' => $subject,
 			'pp' => $passwordPrefix,
-			'notBefore' => $this->timeFactory->getTime() + self::TOKEN_LIFETIME * 2, // multiply to provide a grace period
+			'notBefore' => $this->timeFactory->getTime() + $expirationTime * 2, // multiply to provide a grace period
+			'notBefore' => $this->timeFactory->getTime() + $expirationTime, // multiply to provide a grace period
 		]);
 		$this->jobList->add(CleanUpJob::class, $jobArgs);