throw new IllegalArgumentException(e);
}
}
public ParsedToken decode(String tokenString) throws InvalidTokenException {
ValidToken token;
try {
token = emailRegistrationToken.checkToken(tokenString, null);
} catch (XsrfException err) {
throw new InvalidTokenException(err);
}
if (token == null || token.getData() == null || token.getData().isEmpty()) {
throw new InvalidTokenException();
}
String payload;
try {
payload = new String(Base64.decode(token.getData()), "UTF-8");
} catch (UnsupportedEncodingException err) {
throw new InvalidTokenException(err);
}
Matcher matcher = Pattern.compile("^([0-9]+):(.+@.+)$").matcher(payload);