Skip to content

Commit

Permalink
fix: Disable gmail signups for now
Browse files Browse the repository at this point in the history
  • Loading branch information
storm1729 committed Jan 16, 2024
1 parent d554f53 commit e0f33a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/app/[lang]/signup/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ export default function SignUp(props: { d: Dictionary }): React.ReactElement {
const handleSignup = async () => {
setLoading(true);
setMessage(undefined);
if (email.endsWith("@gmail.com")) {
setMessage({
type: "error",
content:
"Gmail addresses are currently disabled due to spam abuse. Please use a company email.",
});
setLoading(false);
return;
}

const { error } = await supabase.auth.signUp({
email,
password,
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/v0/check_email/checkUserInDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export async function checkUserInDB(req: NextRequest): Promise<UserWithSub> {
const max = subApiMaxCalls(subAndCalls.product_id);
const rateLimitHeaders = getRateLimitHeaders(
new RateLimiterRes(
max - numberOfCalls - 1,
max - numberOfCalls - 1, // -1 because we just consumed 1 email.
msDiff,
numberOfCalls,
undefined
), // 1st arg has -1, because we just consumed 1 email.
),
max
);

Expand Down

1 comment on commit e0f33a3

@vercel
Copy link

@vercel vercel bot commented on e0f33a3 Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

webapp – ./

webapp-git-production-reacher.vercel.app
webapp-reacher.vercel.app

Please sign in to comment.