# Issue while trying to protect routes!

**URL:** <https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004>\
**Category:** Routing\
**Created:** [July 18, 2021, 2:38pm UTC](https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004 "2021-07-18T14:38:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![almokhtar](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@almokhtar](https://discuss.emberjs.com/u/almokhtar)\
**Post date:** [July 18, 2021, 2:38pm UTC](https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004/1 "2021-07-18T14:38:31Z")

</div>

Hello i followed docs in simple auth to how to protect routes, so only logged in users can view the link but am getting this error ![Screenshot 2021-07-18 at 15.33.37](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/5/3/53505f3dff733d723db39a0fb571d4a7220db1c7.png)

 ![Screenshot 2021-07-18 at 15.33.58](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/0/c/0c908c169917e7129da90a42aee55a338d04681e.png) ![Screenshot 2021-07-18 at 15.34.16](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/2/b/2bab4f5eab48ad238e72f31aa0537c3180c96e11.png) ![Screenshot 2021-07-18 at 15.34.25](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/7/8/78edf2c689cd89936c0ce83eedc8dd0336a3c6c1.png) ![Screenshot 2021-07-18 at 15.34.32](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/6/7/67f588b2e56e88c283259b1bd73bde89bcf22f77.png)

---

<div class="post-metadata">

**Author:** ![almokhtar](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@almokhtar](https://discuss.emberjs.com/u/almokhtar)\
**Post date:** [July 18, 2021, 3:02pm UTC](https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004/2 "2021-07-18T15:02:12Z")

</div>

Update: i just extended from authenticated class to the route i wanna protect and it looks like it works, is this the right way ?

 ![Screenshot 2021-07-18 at 16.01.39](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/b/6/b66f41df48a7a525d5b55a7164f66fc6c97843fa.png)

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [July 19, 2021, 2:35pm UTC](https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004/3 "2021-07-19T14:35:18Z")

</div>

That should work. I’m not 100% what the most current recommendations are but that definitely seems less problematic than nesting routes as you’d have to change all of your links. If you’re still curious about the first example and why it was broken it was because the “home” route was nested under “authenticated” route which means you would have needed to refer to the route as `authenticated.home` instead of just `home`.

---

<div class="post-metadata">

**Author:** ![almokhtar](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@almokhtar](https://discuss.emberjs.com/u/almokhtar)\
**Post date:** [July 19, 2021, 4:02pm UTC](https://discuss.emberjs.com/t/issue-while-trying-to-protect-routes/19004/4 "2021-07-19T16:02:02Z")

</div>

thank you! actually just started playing with ember last month and it looks neat!
