Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix User can an access sign-up page after sign-up
  • Loading branch information
haotangio committed Jul 3, 2015
commit 0ffbce7414a10978061b5e94857bffdfad69eb96
8 changes: 8 additions & 0 deletions shared/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Router.map ->
@route "entrySignIn",
path: "/sign-in"
onBeforeAction: ->
if Meteor.user()
Router.go AccountsEntry.settings.dashboardRoute
Session.set('entryError', undefined)
Session.set('buttonText', 'in')
@next()
Expand Down Expand Up @@ -34,6 +36,8 @@ Router.map ->
@route "entrySignUp",
path: "/sign-up"
onBeforeAction: ->
if Meteor.user()
Router.go AccountsEntry.settings.dashboardRoute
Session.set('entryError', undefined)
Session.set('buttonText', 'up')
@next()
Expand Down Expand Up @@ -62,6 +66,8 @@ Router.map ->
@route "entryForgotPassword",
path: "/forgot-password"
onBeforeAction: ->
if Meteor.user()
Router.go AccountsEntry.settings.dashboardRoute
Session.set('entryError', undefined)
@next()

Expand All @@ -78,6 +84,8 @@ Router.map ->
@route 'entryResetPassword',
path: 'reset-password/:resetToken'
onBeforeAction: ->
if Meteor.user()
Router.go AccountsEntry.settings.dashboardRoute
Session.set('entryError', undefined)
Session.set('resetToken', @params.resetToken)
@next()
Expand Down