# Failed to log out due to return to URL not defined, although it is clearly set and matched

**URL:** <https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144>\
**Category:** Get Help\
**Created:** [December 1, 2020, 3:27pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144 "2020-12-01T15:27:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJJ](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rjj/32/24112_2.png) [@RJJ](https://community.auth0.com/u/RJJ)\
**Post date:** [December 1, 2020, 3:27pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144/1 "2020-12-01T15:27:30Z")

</div>

The “returnTo” querystring parameter “[https://XXX.auth0.com/v2/logout?returnTo=XXX:XXX](https://XXX.auth0.com/v2/logout?returnTo=XXX:XXX)” is not defined as a valid URL in “Allowed Logout URLs”

It fails to log out from both local server and remote server.

Anyone else is experiencing similar issues?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 2, 2020, 9:54pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144/3 "2020-12-02T21:54:50Z")

</div>

Hi @RJJ,

Would you DM me your tenant name so I can take a look?

---

<div class="post-metadata">

**Author:** ![RJJ](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rjj/32/24112_2.png) [@RJJ](https://community.auth0.com/u/RJJ)\
**Post date:** [December 3, 2020, 2:30pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144/4 "2020-12-03T14:30:42Z")

</div>

Hi Dan,

Thanks for coming back to me.

It is an mis-configuration from my end. for some reason, I used to configure “[https://domain/v2/logout?returnTo=xxx](https://domain/v2/logout?returnTo=xxx)” as the returnTo parameter in client.logout() API call (Auth0 SDK for SPA)

But it appears that we don’t need “[https://domain/v2/logout?returnTo=](https://domain/v2/logout?returnTo=)” in the returnTo parameter string, just specify the redirect URL is sufficient.

Thank you again for coming back to check.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 3, 2020, 11:11pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144/5 "2020-12-03T23:11:35Z")

</div>

Great, I will mark this as resolved. The issue was a misconfig.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 18, 2020, 11:11pm UTC](https://community.auth0.com/t/failed-to-log-out-due-to-return-to-url-not-defined-although-it-is-clearly-set-and-matched/54144/6 "2020-12-18T23:11:36Z")

</div>

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