# Widget UI: Redirecting after successful login

**URL:** <https://community.auth0.com/t/widget-ui-redirecting-after-successful-login/6552>\
**Category:** Get Help\
**Tags:** ui, redirect, javascript\
**Created:** [May 9, 2017, 10:36pm UTC](https://community.auth0.com/t/widget-ui-redirecting-after-successful-login/6552 "2017-05-09T22:36:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarreiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mcarreiro/32/7155_2.png) [@mcarreiro](https://community.auth0.com/u/mcarreiro)\
**Post date:** [May 9, 2017, 10:36pm UTC](https://community.auth0.com/t/widget-ui-redirecting-after-successful-login/6552/1 "2017-05-09T22:36:20Z")

</div>

Hi,

I’m having an issue redirecting to my application after a successful login. I’m looking at the following page of documentation:

> **[Redirect Users - Auth0 Docs](https://auth0.com/docs/authenticate/login/redirect-users-after-login)**
>
> Describes how to redirect users to URLs that have not been added to the AllowList.

And I’ve tried the following code snippet:

```
lock = new Auth0Lock(
    AUTH_LOCK_KEY,
    AUTH_DOMAIN,
    {
        container: "login-content",
        allowedConnections: "Username-Password-Authentication"],
        auth: {
            responseType: "token",
            params: {
                state: {
                    "return_url": "http://localhost:9000/admin/test"
                }
            }
        },
        socialButtonStyle: "big",
        languageDictionary: {"title":"Auth0"},
        language: "en",
        theme: {"primaryColor":"#3A99D8"}
    }
);

```

My goal here is to redirect the user to “[http://localhost:9000/admin/test](http://localhost:9000/admin/test)” after successfully logging in, but the above options do not provide this functionality.

Can anyone point out what I may be doing wrong?

Thanks,

-Mikey

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [May 10, 2017, 9:26am UTC](https://community.auth0.com/t/widget-ui-redirecting-after-successful-login/6552/2 "2017-05-10T09:26:44Z")

</div>

That redirect option is useful if you want to have dynamic redirect URL’s which you have not configured in the `Allowed Callback URLs` client setting. If you will always be redirecting back to a pre-known page, you can do the following:

1. Add the url `http://localhost:9000/admin/test` to your Allowed Callback URLs in the Client settings.
2. Set the `redirectUrl` parameter in Lock:  
[Lock Configuration Options](https://auth0.com/docs/libraries/lock/v10/customization#redirecturl-string-)

---

<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:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/widget-ui-redirecting-after-successful-login/6552/3 "2018-03-02T05:53:48Z")

</div>


