Fix: Purge login
This commit is contained in:
parent
0dd2c64c38
commit
dfd3fbb6ee
|
@ -137,7 +137,7 @@ class Api
|
||||||
|
|
||||||
public function freshLogin(int $mglnr, string $password): self
|
public function freshLogin(int $mglnr, string $password): self
|
||||||
{
|
{
|
||||||
$this->authenticator->purge();
|
$this->authenticator->purge($mglnr);
|
||||||
|
|
||||||
return $this->login($mglnr, $password);
|
return $this->login($mglnr, $password);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ abstract class Authenticator
|
||||||
|
|
||||||
abstract public function login(int $mglnr, string $password): self;
|
abstract public function login(int $mglnr, string $password): self;
|
||||||
|
|
||||||
abstract public function purge(): void;
|
abstract public function purge(int $mglnr): void;
|
||||||
|
|
||||||
abstract public function http(): PendingRequest;
|
abstract public function http(): PendingRequest;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class FakeCookie extends Authenticator
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function purge(): void
|
public function purge(int $mglnr): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class FakeCookie extends Authenticator
|
||||||
{
|
{
|
||||||
Assert::assertFalse(
|
Assert::assertFalse(
|
||||||
$this->isLoggedIn(),
|
$this->isLoggedIn(),
|
||||||
'Failed asserting that noone is logged in. Found login with '.data_get($this->authenticated, 'mglnr')
|
'Failed asserting that noone is logged in. Found login with ' . data_get($this->authenticated, 'mglnr')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,9 @@ class MainCookie extends Authenticator
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function purge(): void
|
public function purge(int $mglnr): void
|
||||||
{
|
{
|
||||||
|
$this->mglnr = $mglnr;
|
||||||
while ($this->file()) {
|
while ($this->file()) {
|
||||||
unlink($this->file());
|
unlink($this->file());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue