Angular 2 AuthGuard Service with redirect?

前端 未结 5 1169
南旧
南旧 2020-12-05 22:46

I have an application that I am building that implements CanActivate on the dashboard route. It works fine accept on page reload, I check a flag in the user service to see i

5条回答
  •  萌比男神i
    2020-12-05 23:39

    You can now return a UrlTree from an AuthGuard, or a boolean true / false.

    Kind of amazed nobody has mentioned this yet! Sorry no example right now, but the idea is pretty simple.

提交回复
热议问题