Skip to content
Browse files

Added success and error pages for the email verification

  • Loading branch information...
1 parent b7cba96 commit fd75098f77aa2a8a2284388e4adb75443db8041b @Joony committed
View
BIN Mnesia.nitrogen@localhost/DECISION_TAB.LOG
Binary file not shown.
View
BIN Mnesia.nitrogen@localhost/LATEST.LOG
Binary file not shown.
View
24 src/pages/web_users_verify_email.erl
@@ -6,20 +6,30 @@ main() ->
[Code] = wf:q("key"),
case db_users:verify_email(Code) of
{atomic,ok} ->
- io:format("Everything looks ok~n");
+ Validated = true,
+ %io:format("Everything looks ok~n");
{aborted, "invalid verification code"} ->
- io:format("Invalid verification code~n");
+ Validated = false,
+ wf:redirect("/web/errors/verification/email"),
+ %io:format("Invalid verification code~n");
_ ->
- io:format("Something went wrong~n")
+ Validated = false,
+ wf:redirect("/web/errors/unexpected"),
+ %io:format("Something went wrong~n")
end,
-
-#template { file="./wwwroot/template.html"}.
+ #template { file="./wwwroot/validation.html", bindings=[{'Validated', Validated}] }.
title() ->
"web_users_verify_email".
-body() ->
- #label{text="web_users_verify_email body."}.
+body(Validated) ->
+ io:format("Validated = ~s~n", [Validated]),
+ case Validated of
+ true ->
+ #label{text="Your email address has been successfully validated"};
+ _ ->
+ #label{text="There was a problem validating your email address"}
+ end.
event(_) -> ok.
View
1 wwwroot/template.html
@@ -19,7 +19,6 @@
[[[page:body()]]]
-
<script>
[[[script]]]
</script>

0 comments on commit fd75098

Please sign in to comment.
Something went wrong with that request. Please try again.