diff --git a/client/src/routes/verify.js b/client/src/routes/verify.js
index 6185175..0a1d6ec 100644
--- a/client/src/routes/verify.js
+++ b/client/src/routes/verify.js
@@ -11,21 +11,23 @@ const Verify = () => {
useEffect(() => {
document.title = `Verify | ${config.ctfName}`
+ }, [])
- ;(async () => {
- const qs = new URLSearchParams(location.search)
- if (qs.has('token')) {
- const verifyRes = await verify({ verifyToken: qs.get('token') })
- if (verifyRes.authToken) {
- setAuthToken(verifyRes.authToken)
- } else if (verifyRes.emailSet) {
- setEmailSet(true)
- } else {
- setError(verifyRes.verifyToken)
- }
+ const handleVerifyClick = async () => {
+ const qs = new URLSearchParams(location.search)
+ if (qs.has('token')) {
+ const verifyRes = await verify({ verifyToken: qs.get('token') })
+ if (verifyRes.authToken) {
+ setAuthToken(verifyRes.authToken)
+ } else if (verifyRes.emailSet) {
+ setEmailSet(true)
+ } else {
+ setError(verifyRes.verifyToken)
}
- })()
- }, [])
+ } else {
+ setError("No verification token provided.")
+ }
+ }
if (error) {
return
@@ -37,6 +39,18 @@ const Verify = () => {
)
}
+ if (authToken == null) {
+ return (
+
+
+
Verify email?
+
+
+
+
+
+ )
+ }
return
}