0

I am following the Meteor + Angular2 tutorial to create a test project (for learning purposes, and eventually start something real).

But I'd like to have the app redirect unauthenticated users to a /login page instead of what's described in the tutorial (i.e. restrict resources to authenticated users). Basically, unauthenticated users should not even be able to view the application and always be redirected to a login form. Just like Facebook, for example.

How do I do that?

Hongbo Miao
  • 45,290
  • 60
  • 174
  • 267
Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
  • I guess checking it from the server-side must be taken into account, have a look at [this](http://stackoverflow.com/questions/18030065/prevent-angularjs-controller-call-if-unauthenticated). – Sina Oct 06 '15 at 04:42
  • Yes, I came across similar solutions, but 1) I'm using Angular2, and 2) I'm quite not familiar with either Angular and Angular2... so all this voodoo magic with Meteor eludes me somehow :) I am, however, *very* familiar with Node.js and Web apps in general (express, Koa). – Yanick Rochon Oct 06 '15 at 04:47
  • I used this (http://stackoverflow.com/questions/34331478/angular2-redirect-to-login-page) solution and it works fine, just modify the auth check with Meteor.user() – bre Jan 16 '16 at 18:50

0 Answers0