# Does discourse has return\_path or return\_link I can leverage to redirect to previous link after log in complete?

**URL:** <https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565>\
**Category:** Support\
**Tags:** login\
**Created:** [August 20, 2026, 6:53pm UTC](https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565 "2026-08-20T18:53:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahrear\_Chowdhury](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shahrear_chowdhury/32/574735_2.png) [@Shahrear\_Chowdhury](https://meta.discourse.org/u/Shahrear_Chowdhury)\
**Post date:** [August 20, 2026, 6:53pm UTC](https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565/1 "2026-08-20T18:53:05Z")

</div>

Why does after logging in Discourse doesn’t return to this path?

[https://discourse.test.com/login?return\_path=%2Fsecure-uploads%2Foriginal%2F2X%2F0%2F0f72a30f024ed5e37791d404a1fc611e90606650.pdf](https://discourse.test.com/login?return_path=%2Fsecure-uploads%2Foriginal%2F2X%2F0%2F0f72a30f024ed5e37791d404a1fc611e90606650.pdf)

Essentially we want below scenario to work

User visits a file thats not open to public they see 404 and redirected to login after few seconds and after logging they should come back to file and download?

Do I need to do anything custom? I just added return\_path at the end using javascript on component.

Please help me out!

TY

---

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [August 21, 2026, 12:01am UTC](https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565/2 "2026-08-21T00:01:36Z")

</div>

There is a cookie called ‘destination\_url’ that adds the page before login (e.g. a topic), and uses the cookie, then removes it after login is successful.

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/1/d/91d744ed4969f07db7eec5207b65bec83cf11fb1.png)

> <https://github.com/discourse/discourse/blob/c81547dfdacff2d17af47de94a398fc01c9af88f/frontend/discourse/app/routes/login.js#L57-L63>

> <https://github.com/discourse/discourse/blob/c81547dfdacff2d17af47de94a398fc01c9af88f/frontend/discourse/app/instance-initializers/auth-complete.js#L84-L96>

---

<div class="post-metadata">

**Author:** ![Shahrear\_Chowdhury](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shahrear_chowdhury/32/574735_2.png) [@Shahrear\_Chowdhury](https://meta.discourse.org/u/Shahrear_Chowdhury)\
**Post date:** [August 22, 2026, 8:30pm UTC](https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565/3 "2026-08-22T20:30:15Z")

</div>

thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [September 21, 2026, 8:31pm UTC](https://meta.discourse.org/t/does-discourse-has-return-path-or-return-link-i-can-leverage-to-redirect-to-previous-link-after-log-in-complete/410565/4 "2026-09-21T20:31:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
