-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05849a7
commit 3cedb74
Showing
6 changed files
with
135 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,10 @@ import { useUser } from "@/util/useUser"; | |
|
||
function alertError(email: string, e: string) { | ||
alert( | ||
`An unexpected error happened. Can you email [email protected] with this message (or a screenshot)?\n\nEmail: ${email}\n${e}` | ||
`An unexpected error happened. Can you email [email protected] with this message (or a screenshot)? | ||
Email: ${email} | ||
Error: ${e}` | ||
); | ||
} | ||
|
||
|
@@ -39,6 +42,7 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement { | |
} | ||
|
||
setLoading(true); | ||
console.log("[/dashboard] Verifying email", email); | ||
postData<CheckEmailOutput>({ | ||
url: `/api/v0/check_email`, | ||
token: userDetails?.api_token, | ||
|
@@ -51,6 +55,16 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement { | |
setLoading(false); | ||
return onVerified && onVerified(r); | ||
}) | ||
.catch((err: Error) => { | ||
if (err.message.includes("The result contains 0 rows")) { | ||
throw new Error( | ||
`The email ${email} can't be verified within 1 minute. This is because the email provider imposes obstacles to prevent real-time email verification, such as greylisting. | ||
Please try again later.` | ||
); | ||
} | ||
|
||
throw err; | ||
}) | ||
.catch((err: Error) => { | ||
sentryException(err); | ||
alertError(email, err.message); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1960,6 +1960,13 @@ | |
dependencies: | ||
"@types/node" "*" | ||
|
||
"@types/async-retry@^1.4.8": | ||
version "1.4.8" | ||
resolved "https://registry.yarnpkg.com/@types/async-retry/-/async-retry-1.4.8.tgz#eb32df13aceb9ba1a8a80e7fe518ff4e3fe46bb3" | ||
integrity sha512-Qup/B5PWLe86yI5I3av6ePGaeQrIHNKCwbsQotD6aHQ6YkHsMUxVZkZsmx/Ry3VZQ6uysHwTjQ7666+k6UjVJA== | ||
dependencies: | ||
"@types/retry" "*" | ||
|
||
"@types/async@^3.2.16": | ||
version "3.2.18" | ||
resolved "https://registry.yarnpkg.com/@types/async/-/async-3.2.18.tgz#3d93dde6eab654f7bc23e549d9af5d3fa4a5bdc5" | ||
|
@@ -2178,6 +2185,11 @@ | |
dependencies: | ||
"@types/node" "*" | ||
|
||
"@types/retry@*": | ||
version "0.12.5" | ||
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.5.tgz#f090ff4bd8d2e5b940ff270ab39fd5ca1834a07e" | ||
integrity sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw== | ||
|
||
"@types/scheduler@*": | ||
version "0.16.2" | ||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" | ||
|
@@ -2729,6 +2741,13 @@ astring@^1.6.0: | |
resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.4.tgz#6d4c5d8de7be2ead9e4a3cc0e2efb8d759378904" | ||
integrity sha512-97a+l2LBU3Op3bBQEff79i/E4jMD2ZLFD8rHx9B6mXyB2uQwhJQYfiDqUwtfjF4QA1F2qs//N6Cw8LetMbQjcw== | ||
|
||
async-retry@^1.3.3: | ||
version "1.3.3" | ||
resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" | ||
integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== | ||
dependencies: | ||
retry "0.13.1" | ||
|
||
async-sema@^3.1.1: | ||
version "3.1.1" | ||
resolved "https://registry.yarnpkg.com/async-sema/-/async-sema-3.1.1.tgz#e527c08758a0f8f6f9f15f799a173ff3c40ea808" | ||
|
@@ -7682,6 +7701,11 @@ restore-cursor@^3.1.0: | |
onetime "^5.1.0" | ||
signal-exit "^3.0.2" | ||
|
||
[email protected]: | ||
version "0.13.1" | ||
resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" | ||
integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== | ||
|
||
reusify@^1.0.4: | ||
version "1.0.4" | ||
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" | ||
|
3cedb74
There was a problem hiding this comment.
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-reacher.vercel.app
api.reacher.email
webapp-git-production-reacher.vercel.app
app.reacher.email