Skip to content

Commit 38a7f10

Browse files
committed
fix: PR feedbacks
1 parent f73b9fb commit 38a7f10

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/features/auth/OAuthLogin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const OAuthLoginButton = ({
5454
};
5555

5656
export const OAuthLoginButtonsGrid = () => {
57-
if (!OAUTH_PROVIDERS_ENABLED_ARRAY.some((p) => p.isEnabled)) return null;
57+
if (!OAUTH_PROVIDERS_ENABLED_ARRAY.length) return null;
5858
return (
5959
<SimpleGrid columns={2} gap={3}>
6060
{OAUTH_PROVIDERS_ENABLED_ARRAY.map(({ provider }) => {

src/server/config/oauth/providers/google.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ export const google: OAuthClient = {
4848
message: 'Missing Google environment variables',
4949
});
5050
}
51-
if (!codeVerifier) throw new Error('Missing codeVerifier');
51+
if (!codeVerifier) {
52+
throw new TRPCError({
53+
code: 'BAD_REQUEST',
54+
message: 'Missing codeVerifier',
55+
});
56+
}
5257
return googleClient.validateAuthorizationCode(code, codeVerifier);
5358
},
5459
getUser: async ({ accessToken, ctx }) => {

0 commit comments

Comments
 (0)