Skip to content

Commit 50ccf7e

Browse files
committed
Validate the password before generating an apptoken
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent a6882de commit 50ccf7e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/Command/User/AddAppPassword.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109109
return 1;
110110
}
111111

112-
$output->writeln('<info>The password is not validated so what you provide is what gets recorded in the token</info>');
113-
112+
if (!$this->userManager->checkPassword($user->getUID(), $password)) {
113+
$output->writeln('<error>The provided password is invalid</error>');
114+
return 1;
115+
}
114116

115117
$token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
116118
$generatedToken = $this->tokenProvider->generateToken(

0 commit comments

Comments
 (0)