Skip to content

Commit

Permalink
fix: PR feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-dalmet committed Oct 21, 2024
1 parent c9ba9fc commit 7cbdbfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/features/auth/OAuthLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<SimpleGrid columns={2} gap={3}>
{OAUTH_PROVIDERS_ENABLED_ARRAY.map(({ provider }) => {
Expand Down
7 changes: 6 additions & 1 deletion src/server/config/oauth/providers/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 7cbdbfe

Please sign in to comment.