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 @@