Skip to content

Commit

Permalink
Track previous url when we redirect to sign-in page and unset it once…
Browse files Browse the repository at this point in the history
… we redirect back. Fixes #13
  • Loading branch information
queso committed Feb 17, 2014
1 parent 43a8618 commit 6d73b80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/entry.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AccountsEntry =
signInRequired: (router, extraCondition) ->
extraCondition ?= true
unless Meteor.user() and extraCondition
Session.set('fromWhere', router.path)
Router.go('/sign-in')
Session.set('entryError', i18n('error.signInRequired'))
router.stop()
Expand Down
1 change: 1 addition & 0 deletions client/views/signIn/signIn.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Template.entrySignIn.events
T9NHelper.accountsError err
else if Session.get('fromWhere')
Router.go Session.get('fromWhere')
Session.set('fromWhere', undefined)
else
Router.go AccountsEntry.settings.dashboardRoute
)
1 change: 1 addition & 0 deletions client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Template.entrySignUp.events
T9NHelper.accountsError err
else if Session.get('fromWhere')
Router.go Session.get('fromWhere')
Session.set('fromWhere', undefined)
else
Router.go AccountsEntry.settings.dashboardRoute
)
Expand Down

0 comments on commit 6d73b80

Please sign in to comment.