Browse Source

Redirect to the right token on public shares

If the token doesn't match (or isn't set) during the redirect. We should
properly set it. Else we might redirect to a later auth display that set
these values.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v17.0.0beta1
Roeland Jago Douma 5 years ago
parent
commit
96e51b5f6f
No account linked to committer's email address
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      lib/public/AppFramework/AuthPublicShareController.php

+ 14
- 0
lib/public/AppFramework/AuthPublicShareController.php View File

@@ -185,6 +185,20 @@ abstract class AuthPublicShareController extends PublicShareController {
$route = $params['_route'];
unset($params['_route']);
}

// If the token doesn't match the rest of the arguments can't be trusted either
if (isset($params['token']) && $params['token'] !== $this->getToken()) {
$params = [
'token' => $this->getToken(),
];
}

// We need a token
if (!isset($params['token'])) {
$params = [
'token' => $this->getToken(),
];
}
}

return new RedirectResponse($this->urlGenerator->linkToRoute($route, $params));

Loading…
Cancel
Save