# Redirect URI issue after successful login with @auth0/auth0-angular

**URL:** <https://community.auth0.com/t/redirect-uri-issue-after-successful-login-with-auth0-auth0-angular/58111>\
**Category:** Get Help\
**Tags:** redirecturi, redirect, angular, login\
**Created:** [February 18, 2021, 9:18pm UTC](https://community.auth0.com/t/redirect-uri-issue-after-successful-login-with-auth0-auth0-angular/58111 "2021-02-18T21:18:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![frederik.prijck](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/frederik.prijck/32/27014_2.png) [@frederik.prijck](https://community.auth0.com/u/frederik.prijck)\
**Post date:** [February 25, 2021, 10:06pm UTC](https://community.auth0.com/t/redirect-uri-issue-after-successful-login-with-auth0-auth0-angular/58111/2 "2021-02-25T22:06:39Z")

</div>

Hi.

It looks like what is happening is expected.  
Our Angular SDK is configured to work as follows:

- User initiates login by calling loginWithRedirect
- User is redirected to Auth0, including a redirectUri (in this case /callback)
- User is, after succesful authentication, redirected back to the provided redirectUri (in this case /callback)
- The callback URL is used only to process code and state in order to retrieve an actual token
- The user is then redirected again to /

However, if you want to not be redirected back to `/` in the very last step, but instead they want the user to end up at a different URL, they can do so by providing that information to `loginWithRedirect()` :

```
loginWithRedirect({
  appState: { target: '/some-url' }
})

```

By doing that, in the very last step the SDK will not redirect the user back to `/` , but to `/some-url` instead (see [https://github.com/auth0/auth0-angular/blob/master/projects/auth0-angular/src/lib/auth.service.ts#L299](https://github.com/auth0/auth0-angular/blob/master/projects/auth0-angular/src/lib/auth.service.ts#L299)).

> I record the current path in local storage before calling this.authService.loginWithRedirect()

There is no need for doing this. If you provide that route to `{ appState: { target: ''}}`, our SDK will store it in Session Storage for you.

---

_[View the full topic](https://community.auth0.com/t/redirect-uri-issue-after-successful-login-with-auth0-auth0-angular/58111)._
