benbaran / adal-angular4-example

Angular 4 ADAL Wrapper Example
28 stars 13 forks source link

Where's routing control? #20

Closed sebastiangug closed 6 years ago

sebastiangug commented 6 years ago

First off -- thanks for the package and great work!

I'm trying to implement routing to welcome page if not authenticated and then forward to the homepage once they get authenticated.

All the examples that I've found out there with other adal strategies seem to do this in the logged-in.guard, in our case, adal.guard -- but we don't have access to modify the adal.guard in this example.

Am I missing something or is that something I should look at implementing completely independent from this package?

Thanks!

sebastiangug commented 6 years ago

My main problem was wanting to show something if someone is not logged in. I've seen others implement this with forwards and other stuff.

Instead, I just made a div on app.component.html with whatever message I wanted and applied

<div *ngIf="!this.adalService.userInfo.authenticated">

I now feel very stupid for not thinking of this before.