Fix login with basic auth

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-09-05 12:14:28 +02:00 committed by Morris Jobke
parent faffebc718
commit dbcd549e35
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 5 additions and 2 deletions

View File

@ -293,7 +293,6 @@ class Manager {
return false;
}
} catch (InvalidTokenException $e) {
return true;
}
}

View File

@ -566,6 +566,8 @@ class ManagerTest extends TestCase {
}
public function testNeedsSecondFactorInvalidToken() {
$this->prepareNoProviders();
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('user');
@ -579,6 +581,8 @@ class ManagerTest extends TestCase {
->with('mysessionid')
->willThrowException(new OC\Authentication\Exceptions\InvalidTokenException());
$this->assertTrue($this->manager->needsSecondFactor($user));
$this->config->method('getUserKeys')->willReturn([]);
$this->assertFalse($this->manager->needsSecondFactor($user));
}
}