Merge pull request #6364 from nextcloud/fix_login_loop
Fix login with basic auth
This commit is contained in:
commit
5d4540f179
|
@ -293,7 +293,6 @@ class Manager {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (InvalidTokenException $e) {
|
} catch (InvalidTokenException $e) {
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -566,6 +566,8 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNeedsSecondFactorInvalidToken() {
|
public function testNeedsSecondFactorInvalidToken() {
|
||||||
|
$this->prepareNoProviders();
|
||||||
|
|
||||||
$user = $this->createMock(IUser::class);
|
$user = $this->createMock(IUser::class);
|
||||||
$user->method('getUID')
|
$user->method('getUID')
|
||||||
->willReturn('user');
|
->willReturn('user');
|
||||||
|
@ -579,6 +581,8 @@ class ManagerTest extends TestCase {
|
||||||
->with('mysessionid')
|
->with('mysessionid')
|
||||||
->willThrowException(new OC\Authentication\Exceptions\InvalidTokenException());
|
->willThrowException(new OC\Authentication\Exceptions\InvalidTokenException());
|
||||||
|
|
||||||
$this->assertTrue($this->manager->needsSecondFactor($user));
|
$this->config->method('getUserKeys')->willReturn([]);
|
||||||
|
|
||||||
|
$this->assertFalse($this->manager->needsSecondFactor($user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue