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

Route automatically resolves to admin/admin/login #11

Open
balasivagnanam opened this issue Jan 16, 2016 · 4 comments
Open

Route automatically resolves to admin/admin/login #11

balasivagnanam opened this issue Jan 16, 2016 · 4 comments

Comments

@balasivagnanam
Copy link

I am getting this error when I am trying to access the admin panel

There is no route for the path: /admin/admin/login

I use flow router in my app.

@corv89
Copy link

corv89 commented Jan 27, 2016

Using flow router and opening /admin I get redirected to /admin/admin/login which is an empty page.

This also happens when Roles.userIsInRole(Meteor.userId(), 'admin'); returns true. When I override the Admin.isAdmin function I get sent to the dashboard at /admin correctly.

@bartspedden
Copy link

+1 - also using flow-router with meteor 1.3.3.1

@JulianKingman
Copy link

Same here

@JulianKingman
Copy link

@corv89 your comment pointed me in the right direction. This package makes use of the roles at the router level of FlowRouter, which according to Kadira is a no-no (see here: https://kadira.io/academy/meteor-routing-guide/content/subscriptions-and-data-management/with-blaze). The only data available at the router level is Meteor.userId(), Meteor.user() and the roles haven't loaded yet.

The solution is to wrap the admin template with an {{#if isInRole 'admin'}} tag. I'll make a PR.

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

4 participants