diff --git a/src/features/auth/OAuthLogin.tsx b/src/features/auth/OAuthLogin.tsx index b1eac1b3e..5876aa788 100644 --- a/src/features/auth/OAuthLogin.tsx +++ b/src/features/auth/OAuthLogin.tsx @@ -54,7 +54,7 @@ export const OAuthLoginButton = ({ }; export const OAuthLoginButtonsGrid = () => { - if (!OAUTH_PROVIDERS_ENABLED_ARRAY.some((p) => p.isEnabled)) return null; + if (!OAUTH_PROVIDERS_ENABLED_ARRAY.length) return null; return ( {OAUTH_PROVIDERS_ENABLED_ARRAY.map(({ provider }) => { diff --git a/src/server/config/oauth/providers/google.ts b/src/server/config/oauth/providers/google.ts index f96ac3b18..8b727f4bd 100644 --- a/src/server/config/oauth/providers/google.ts +++ b/src/server/config/oauth/providers/google.ts @@ -48,7 +48,12 @@ export const google: OAuthClient = { message: 'Missing Google environment variables', }); } - if (!codeVerifier) throw new Error('Missing codeVerifier'); + if (!codeVerifier) { + throw new TRPCError({ + code: 'BAD_REQUEST', + message: 'Missing codeVerifier', + }); + } return googleClient.validateAuthorizationCode(code, codeVerifier); }, getUser: async ({ accessToken, ctx }) => {