]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/Verify.java
fix: display verify information only when verification token is known.
[gigi.git] / src / org / cacert / gigi / pages / Verify.java
index d7e5aed6bfe405c22512822755ab108da412c759..bc4639810cd591dcc5cf7a53e4117d3cb12f3fed 100644 (file)
@@ -52,6 +52,13 @@ public class Verify extends Page {
             } else {
                 throw new IllegalArgumentException();
             }
+            try {
+                if ( !target.isVerifyable(hash)) {
+                    throw new IllegalArgumentException();
+                }
+            } catch (GigiApiException e) {
+                throw new IllegalArgumentException(e);
+            }
         }
 
         @Override
@@ -62,14 +69,14 @@ public class Verify extends Page {
                 try {
                     target.verify(hash);
                 } catch (IllegalArgumentException e) {
-                    throw new GigiApiException("The email address is invalid.");
+                    throw new PermamentFormException(new GigiApiException("Given token could not be found to complete the verification process (Email Ping)."));
                 }
                 return new SuccessMessageResult(new Scope(emailAddressVerified, data));
             } else if ("domain".equals(type)) {
                 try {
                     target.verify(hash);
                 } catch (IllegalArgumentException e) {
-                    throw new GigiApiException("The domain is invalid.");
+                    throw new PermamentFormException(new GigiApiException("Given token could not be found to complete the verification process (Domain Ping)."));
                 }
                 return new SuccessMessageResult(new Scope(domainVerified, data));
             } else {