mirror of
https://github.com/fazo96/homework.git
synced 2025-01-10 12:14:22 +01:00
fix #24
This commit is contained in:
parent
819c56c98e
commit
11cdfa2a22
@ -52,6 +52,7 @@ loggedInController = RouteController.extend
|
|||||||
@render 'loading'
|
@render 'loading'
|
||||||
else @render()
|
else @render()
|
||||||
onBeforeAction: ->
|
onBeforeAction: ->
|
||||||
|
showError()
|
||||||
if not getUser() then Router.go 'home'
|
if not getUser() then Router.go 'home'
|
||||||
else if not amIValid() then Router.go 'verifyEmail'
|
else if not amIValid() then Router.go 'verifyEmail'
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ guestController = RouteController.extend
|
|||||||
@render 'reconnect'
|
@render 'reconnect'
|
||||||
else @render()
|
else @render()
|
||||||
onBeforeAction: ->
|
onBeforeAction: ->
|
||||||
|
showError()
|
||||||
if getUser()
|
if getUser()
|
||||||
if amIValid() is no then Router.go 'verifyEmail' else Router.go 'notes'
|
if amIValid() is no then Router.go 'verifyEmail' else Router.go 'notes'
|
||||||
|
|
||||||
@ -231,11 +233,12 @@ Template.notifications.events
|
|||||||
# "Error" visualization template
|
# "Error" visualization template
|
||||||
errorDep = new Deps.Dependency; shownError = undefined
|
errorDep = new Deps.Dependency; shownError = undefined
|
||||||
showError = (err) ->
|
showError = (err) ->
|
||||||
shownError = err; shownError.type = err.type or "danger"
|
if err?
|
||||||
|
shownError = err; shownError.type = err.type or "danger"
|
||||||
|
else shownError = undefined
|
||||||
errorDep.changed()
|
errorDep.changed()
|
||||||
clearError = -> shownError = undefined; errorDep.changed()
|
|
||||||
Template.error.error = -> errorDep.depend(); shownError
|
Template.error.error = -> errorDep.depend(); shownError
|
||||||
Template.error.events 'click .close': -> clearError()
|
Template.error.events 'click .close': -> showError()
|
||||||
|
|
||||||
# Verify Email page
|
# Verify Email page
|
||||||
Template.verifyEmail.token = -> Router.current().params.token
|
Template.verifyEmail.token = -> Router.current().params.token
|
||||||
@ -243,7 +246,6 @@ Template.verifyEmail.events
|
|||||||
'click #btn-verify': (e,template) ->
|
'click #btn-verify': (e,template) ->
|
||||||
t = template.find('#token-field').value; t = t.split("/")
|
t = template.find('#token-field').value; t = t.split("/")
|
||||||
t = t[t.length-1] # Remove all the part before the last "/"
|
t = t[t.length-1] # Remove all the part before the last "/"
|
||||||
console.log "Email ver. using token: "+template.find('#token-field').value
|
|
||||||
Accounts.verifyEmail t, (err) ->
|
Accounts.verifyEmail t, (err) ->
|
||||||
if err then errCallback err else Router.go 'notes'
|
if err then errCallback err else Router.go 'notes'
|
||||||
'click #btn-resend': ->
|
'click #btn-resend': ->
|
||||||
|
@ -56,9 +56,10 @@ Meteor.methods
|
|||||||
{$set : { "resume.loginTokens" : [] } }, { multi: yes }
|
{$set : { "resume.loginTokens" : [] } }, { multi: yes }
|
||||||
return yes
|
return yes
|
||||||
no
|
no
|
||||||
|
|
||||||
|
# Allow users to change their date format
|
||||||
Meteor.users.allow
|
Meteor.users.allow
|
||||||
update: (id,doc,fields,mod) ->
|
update: (id,doc,fields,mod) ->
|
||||||
if fields[0] == 'dateformat' and fields.length == 1
|
if fields[0] == 'dateformat' and fields.length == 1
|
||||||
console.log mod
|
|
||||||
return yes
|
return yes
|
||||||
return no
|
return no
|
||||||
|
Loading…
Reference in New Issue
Block a user