Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensureSignedIn and layoutTemplates #9

Open
gru99 opened this issue Dec 10, 2015 · 2 comments
Open

ensureSignedIn and layoutTemplates #9

gru99 opened this issue Dec 10, 2015 · 2 comments

Comments

@gru99
Copy link

gru99 commented Dec 10, 2015

I seem to have a problem. I switched to layoutTemplates in Iron Router and the ensureSignedIn-Plugin started to misbehave (it took me some time to realise as I was signed in for a few weeks). When I try to access /assign the layout template is displayed for a short moment, then he obviously notices, that I'm not logged in anymore – but instead of redirecting me to a login page, he just serves the yieldTemplates. If I switch back to "template: 'home'" for this route (i.e. without a layoutTemplate) everything's fine.

Router.plugin('ensureSignedIn', {
except:['root', 'atSignIn', 'atSignUp', 'atForgotPassword', 'atResetPwd']
});

Router.route('assignRoute', {
path: '/assign',
layoutTemplate: 'mainTemplate',
loadingTemplate: 'loading',
yieldTemplates: {
'home': {to: 'main'},
'filterMenu': {to: 'menu'}
}
});

@desaiuditd
Copy link

Any updates on this ?

I'm having the same problem.

@desaiuditd
Copy link

This fixed it for me.

Moreover, if you wish to customize the template and layout to be used,
you can change them with:

AccountsTemplates.configureRoute('ensureSignedIn', {
    template: 'myLogin',
    layoutTemplate: 'myLayout',
});

It is documented in the readme here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants