From fc80743a93754b8fb302055e7a1d8b5c62aa4d63 Mon Sep 17 00:00:00 2001 From: Frederic Jahn Date: Mon, 6 Jan 2025 16:39:06 +0100 Subject: [PATCH] fix: use lowered id to get third party provider (#2017) * fix: use lowered id to get third party provider * test: fix test * test: increase db max lifetime --- backend/handler/thirdparty_auth_test.go | 2 +- backend/test/database.go | 2 +- backend/thirdparty/provider.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/handler/thirdparty_auth_test.go b/backend/handler/thirdparty_auth_test.go index e1a54cdf1..0cfb63c1d 100644 --- a/backend/handler/thirdparty_auth_test.go +++ b/backend/handler/thirdparty_auth_test.go @@ -101,7 +101,7 @@ func (s *thirdPartySuite) TestThirdPartyHandler_Auth() { requestedRedirectTo: "https://app.test.example", expectedBaseURL: "https://login.test.example", expectedError: thirdparty.ErrorCodeInvalidRequest, - expectedErrorDescription: "unknownProvider", + expectedErrorDescription: "unknown provider", }, { name: "error redirect when requesting a redirectTo that is not allowed", diff --git a/backend/test/database.go b/backend/test/database.go index 375c1dbca..5cc4969e5 100644 --- a/backend/test/database.go +++ b/backend/test/database.go @@ -57,7 +57,7 @@ func StartDB(name string, dialect string) (*TestDB, error) { hostAndPort := resource.GetHostPort(getPortID(dialect)) dsn := getDsn(dialect, hostAndPort) - _ = resource.Expire(120) + _ = resource.Expire(300) pool.MaxWait = 120 * time.Second if err = pool.Retry(func() error { diff --git a/backend/thirdparty/provider.go b/backend/thirdparty/provider.go index adab1bbee..defd55011 100644 --- a/backend/thirdparty/provider.go +++ b/backend/thirdparty/provider.go @@ -94,7 +94,7 @@ func GetProvider(config config.ThirdParty, id string) (OAuthProvider, error) { if strings.HasPrefix(idLower, "custom_") { return getCustomThirdPartyProvider(config, idLower) } else { - return getThirdPartyProvider(config, id) + return getThirdPartyProvider(config, idLower) } }