diff --git a/src/Store/SessionStore.php b/src/Store/SessionStore.php index 9079213d..c1972b0e 100644 --- a/src/Store/SessionStore.php +++ b/src/Store/SessionStore.php @@ -114,10 +114,6 @@ public function getMethod(): ?string */ public function setMethod(?string $method): StoreInterface { - if (in_array($method, $this->getVerifiedMethods() ?? [])) { - throw new InvalidMethodException('You cannot verify with a method you have already verified'); - } - $this->method = $method; return $this; diff --git a/tests/php/Store/SessionStoreTest.php b/tests/php/Store/SessionStoreTest.php index 1e9a5150..b62378da 100644 --- a/tests/php/Store/SessionStoreTest.php +++ b/tests/php/Store/SessionStoreTest.php @@ -25,15 +25,6 @@ public function testAddState() $this->assertSame(['foo' => 'baz', 'bar' => 'baz'], $store->getState()); } - public function testSetMethodWithVerifiedMethod() - { - $this->expectException(\SilverStripe\MFA\Exception\InvalidMethodException::class); - $this->expectExceptionMessage('You cannot verify with a method you have already verified'); - $store = new SessionStore($this->createMock(Member::class)); - $store->addVerifiedMethod('foobar'); - $store->setMethod('foobar'); - } - public function testSetMethod() { $store = new SessionStore($this->createMock(Member::class));