Skip to content
Open
Changes from all commits
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
40 changes: 40 additions & 0 deletions shared/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,27 @@ Router.map ->
onBeforeAction: ->
Session.set('entryError', undefined)
@next()
onRun: ->
if AccountsEntry.settings.forgotPasswordTemplate
@template = AccountsEntry.settings.forgotPasswordTemplate

# If the user has a custom template, and not using the helper, then
# maintain the package Javascript so that OpenGraph tags and share
# buttons still work.
pkgRendered= Template.entryForgotPassword.rendered
userRendered = Template[@template].rendered

if userRendered
Template[@template].rendered = ->
pkgRendered.call(@)
userRendered.call(@)
else
Template[@template].rendered = pkgRendered

Template[@template].events(AccountsEntry.entryForgotPasswordEvents)
Template[@template].helpers(AccountsEntry.entryForgotPasswordHelpers)
@next()

@route 'entrySignOut',
path: '/sign-out'
onBeforeAction: ()->
Expand All @@ -80,6 +100,26 @@ Router.map ->
Session.set('entryError', undefined)
Session.set('resetToken', @params.resetToken)
@next()
onRun: ->
if AccountsEntry.settings.resetPasswordTemplate
@template = AccountsEntry.settings.resetPasswordTemplate

# If the user has a custom template, and not using the helper, then
# maintain the package Javascript so that OpenGraph tags and share
# buttons still work.
pkgRendered= Template.entryResetPassword.rendered
userRendered = Template[@template].rendered

if userRendered
Template[@template].rendered = ->
pkgRendered.call(@)
userRendered.call(@)
else
Template[@template].rendered = pkgRendered

Template[@template].events(AccountsEntry.entryResetPasswordEvents)
Template[@template].helpers(AccountsEntry.entryResetPasswordHelpers)
@next()

# Get all the accounts-entry routes one time
exclusions = []
Expand Down