# What is the v2 equivalent of addAuthorizeStep

**URL:** <https://discourse.aurelia.io/t/what-is-the-v2-equivalent-of-addauthorizestep/5171>\
**Category:** vNext\
**Created:** [May 18, 2023, 9:57pm UTC](https://discourse.aurelia.io/t/what-is-the-v2-equivalent-of-addauthorizestep/5171 "2023-05-18T21:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djedi](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/djedi/32/312_2.png) [@djedi](https://discourse.aurelia.io/u/djedi)\
**Post date:** [May 18, 2023, 9:57pm UTC](https://discourse.aurelia.io/t/what-is-the-v2-equivalent-of-addauthorizestep/5171/1 "2023-05-18T21:57:53Z")

</div>

How do I make sure a user is authorized before loading a view, and redirecting them to /login in they are not authorized?

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [May 21, 2023, 9:20am UTC](https://discourse.aurelia.io/t/what-is-the-v2-equivalent-of-addauthorizestep/5171/2 "2023-05-21T09:20:26Z")

</div>

Hi @djedi! For that, there is the generalized concept of lifecycle hooks. Here is one example how that can be used for authorization purpose: [Router hooks - The Aurelia 2 Docs](https://docs.aurelia.io/router-lite/router-hooks#example-authentication-and-authorization)
