From e87e2fc16d633d5faea3779807bade4bb43c5432 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 2 Jun 2023 14:22:28 -0700 Subject: [PATCH] Fix the routing for the default OAuth2 pages --- app/controllers/web/console.php | 3 ++- tests/e2e/General/HTTPTest.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 329b13b668..571049d9ef 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -6,10 +6,11 @@ use Utopia\App; App::get('/console/*') ->alias('/') + ->alias('auth/*') ->alias('/invite') ->alias('/login') ->alias('/recover') - ->alias('/register') + ->alias('/register/*') ->groups(['web']) ->label('permission', 'public') ->label('scope', 'home') diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index bf44c396a6..36cda53a73 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -159,4 +159,15 @@ class HTTPTest extends Scope $this->assertIsString($body['server-ruby']); $this->assertIsString($body['console-cli']); } + + public function testDefaultOAuth2() + { + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/success', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/auth/oauth2/failure', $this->getHeaders()); + + $this->assertEquals(200, $response['headers']['status-code']); + } }