+ $this->assertFalse(auth()->check());
+ }
+
+ public function test_logout_endpoint_url_overrides_autodiscovery_endpoint()
+ {
+ config()->set(['oidc.end_session_endpoint' => 'https://a.example.com']);
+ $this->withAutodiscovery();
+
+ $transactions = $this->mockHttpClient([
+ $this->getAutoDiscoveryResponse(),
+ $this->getJwksResponse(),
+ ]);
+
+ $resp = $this->asEditor()->post('/oidc/logout');
+ $resp->assertRedirect('https://a.example.com?post_logout_redirect_uri=' . urlencode(url('/')));
+
+ $this->assertEquals(2, $transactions->requestCount());
+ $this->assertFalse(auth()->check());
+ }
+
+ public function test_logout_with_autodiscovery_does_not_use_rp_logout_if_no_url_via_autodiscovery()
+ {
+ config()->set(['oidc.end_session_endpoint' => true]);
+ $this->withAutodiscovery();
+
+ $this->mockHttpClient([
+ $this->getAutoDiscoveryResponse(['end_session_endpoint' => null]),
+ $this->getJwksResponse(),
+ ]);
+
+ $resp = $this->asEditor()->post('/oidc/logout');
+ $resp->assertRedirect('/');
+ $this->assertFalse(auth()->check());