-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit the length of app password names
Signed-off-by: Joas Schilling <coding@schilljs.com>
- Loading branch information
1 parent
0fa17f8
commit a0c7798
Showing
5 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,10 @@ public function generateToken(string $token, | |
string $name, | ||
int $type = IToken::TEMPORARY_TOKEN, | ||
int $remember = IToken::DO_NOT_REMEMBER): IToken { | ||
if (mb_strlen($name) > 128) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nickvergessen
Author
Member
|
||
throw new InvalidTokenException('The given name is too long'); | ||
} | ||
|
||
$dbToken = $this->newToken($token, $uid, $loginName, $password, $name, $type, $remember); | ||
$this->mapper->insert($dbToken); | ||
|
||
|
As I understand, the $name variable woule be the user agent sent by browser in cases. I tested with new chromium edge browser from windows 11. The user agent length was 134 and the exception was thrown out. Would you please consider to extend this value?