File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
lib/private/Authentication/Token
tests/lib/Authentication/Token Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,8 @@ public function invalidateToken(string $token) {
273273 $ tokenEntry = null ;
274274 try {
275275 $ tokenEntry = $ this ->mapper ->getToken ($ tokenHash );
276- } catch (DoesNotExistException ) {}
276+ } catch (DoesNotExistException ) {
277+ }
277278 $ this ->mapper ->invalidate ($ this ->hashToken ($ token ));
278279 $ this ->mapper ->invalidate ($ this ->hashTokenWithEmptySecret ($ token ));
279280 $ this ->cacheInvalidHash ($ tokenHash );
Original file line number Diff line number Diff line change 1818use OCP \AppFramework \Db \DoesNotExistException ;
1919use OCP \AppFramework \Utility \ITimeFactory ;
2020use OCP \Authentication \Token \IToken ;
21+ use OCP \EventDispatcher \IEventDispatcher ;
2122use OCP \ICacheFactory ;
2223use OCP \IConfig ;
2324use OCP \IDBConnection ;
@@ -49,6 +50,8 @@ class PublicKeyTokenProviderTest extends TestCase {
4950 private $ cacheFactory ;
5051 /** @var int */
5152 private $ time ;
53+ /** @var IEventDispatcher */
54+ private $ eventDispatcher ;
5255
5356 protected function setUp (): void {
5457 parent ::setUp ();
@@ -72,6 +75,7 @@ protected function setUp(): void {
7275 $ this ->timeFactory ->method ('getTime ' )
7376 ->willReturn ($ this ->time );
7477 $ this ->cacheFactory = $ this ->createMock (ICacheFactory::class);
78+ $ this ->eventDispatcher = Server::get (IEventDispatcher::class);
7579
7680 $ this ->tokenProvider = new PublicKeyTokenProvider (
7781 $ this ->mapper ,
@@ -82,6 +86,7 @@ protected function setUp(): void {
8286 $ this ->timeFactory ,
8387 $ this ->hasher ,
8488 $ this ->cacheFactory ,
89+ $ this ->eventDispatcher ,
8590 );
8691 }
8792
You can’t perform that action at this time.
0 commit comments