Update password confirmation middleware
If the userbackend doesn't allow validating the password for a given uid then there is no need to perform this check. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
1fd640b40b
commit
603b672a11
|
@ -29,6 +29,7 @@ use OCP\AppFramework\Middleware;
|
|||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\ISession;
|
||||
use OCP\IUserSession;
|
||||
use OCP\User\Backend\IPasswordConfirmationBackend;
|
||||
|
||||
class PasswordConfirmationMiddleware extends Middleware {
|
||||
/** @var ControllerMethodReflector */
|
||||
|
@ -70,6 +71,13 @@ class PasswordConfirmationMiddleware extends Middleware {
|
|||
$user = $this->userSession->getUser();
|
||||
$backendClassName = '';
|
||||
if ($user !== null) {
|
||||
$backend = $user->getBackend();
|
||||
if ($backend instanceof IPasswordConfirmationBackend) {
|
||||
if (!$backend->canConfirmPassword($user->getUID())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$backendClassName = $user->getBackendClassName();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue