Skip to content

Commit

Permalink
Merge pull request #5639 from nextcloud/backport/5636/stable21
Browse files Browse the repository at this point in the history
[stable21] Regenerate session id after entering password
  • Loading branch information
nickvergessen authored May 19, 2021
2 parents 3d5f4b6 + 9bf4d87 commit 1a3ffbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public function index(string $token = '', string $callUser = '', string $passwor
$passwordVerification = $room->verifyPassword($password);

if ($passwordVerification['result']) {
$this->talkSession->renewSessionId();
$this->talkSession->setPasswordForRoom($token, $password);
} else {
$this->talkSession->removePasswordForRoom($token);
Expand Down Expand Up @@ -292,6 +293,7 @@ protected function guestEnterRoom(string $token, string $password): Response {

$passwordVerification = $room->verifyPassword($password);
if ($passwordVerification['result']) {
$this->talkSession->renewSessionId();
$this->talkSession->setPasswordForRoom($token, $password);
} else {
$this->talkSession->removePasswordForRoom($token);
Expand Down
4 changes: 4 additions & 0 deletions lib/TalkSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ protected function removeValue(string $key, string $token): void {

$this->session->set($key, json_encode($values));
}

public function renewSessionId() {
$this->session->regenerateId();
}
}

0 comments on commit 1a3ffbb

Please sign in to comment.