From c5090f25e350ab80bc312d5b938a5f33c0f0c49b Mon Sep 17 00:00:00 2001 From: fazo96 Date: Fri, 30 May 2014 11:40:15 +0200 Subject: [PATCH] better email verification system --- client/client.coffee | 13 +++++++++++-- client/view/templates.html | 2 +- server/server.coffee | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/client/client.coffee b/client/client.coffee index ddea38c..60183e5 100644 --- a/client/client.coffee +++ b/client/client.coffee @@ -35,10 +35,19 @@ Router.map -> if amIValid() is no then Router.go 'verifyEmail' if not @data() then Router.go 'notes' @route 'verifyEmail', + path: '/verify/:token?' template: 'verifyEmail' onBeforeAction: -> - if not getUser() then Router.go 'home' - if amIValid() is yes then Router.go 'notes' + if @params.token? + Accounts.verifyEmail @params.token, (err) -> + if err + Router.go 'home' + errCallback err + else Router.go 'notes' + else if not getUser() + Router.go 'home' + else if amIValid() is yes then Router.go 'notes' + # Client Templates diff --git a/client/view/templates.html b/client/view/templates.html index 1b70ddd..3d42dbb 100644 --- a/client/view/templates.html +++ b/client/view/templates.html @@ -76,7 +76,7 @@