Add fallback to allow user:token basic auth

This commit is contained in:
Christoph Wurst 2016-04-27 10:50:17 +02:00 committed by Thomas Müller
parent fdc2cd7554
commit 7e7d5a2ef2
No known key found for this signature in database
GPG Key ID: A943788A3BBEC44C
1 changed files with 7 additions and 0 deletions

View File

@ -282,6 +282,13 @@ class Session implements IUserSession, Emitter {
$this->session->regenerateId();
$this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
$user = $this->manager->checkPassword($uid, $password);
if ($user === false) {
// Password auth failed, maybe it's a token
$request = \OC::$server->getRequest();
if ($this->validateToken($request, $password)) {
$user = $this->getUser();
}
}
if ($user !== false) {
if (!is_null($user)) {
if ($user->isEnabled()) {