# Getting 'Invalid state' with sign-up, login afterwards works

**URL:** <https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014>\
**Category:** Get Help\
**Created:** [April 2, 2022, 10:09pm UTC](https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014 "2022-04-02T22:09:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lonli.lokli](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lonli.lokli/32/35271_2.png) [@lonli.lokli](https://community.auth0.com/u/lonli.lokli)\
**Post date:** [April 2, 2022, 10:09pm UTC](https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014/1 "2022-04-02T22:09:54Z")

</div>

My workflow:

- passwordless
- magic links, ie registration proceed in another window
- Angular SPA with passwordless Auth0-hosted page
- “@auth0/auth0-angular”: “1.9.0”,

When user is registered, he is redirected on UI but no authentication happened, showed error in console

```auto
app.component.ts:61 
        
       Auth: Error: Invalid state
    at e.<anonymous> (auth0-spa-js.production.esm.js:15:83846)
    at auth0-spa-js.production.esm.js:15:2236
    at Object.next (auth0-spa-js.production.esm.js:15:1552)
    at auth0-spa-js.production.esm.js:15:1278
    at new ZoneAwarePromise (zone.js:1427:1)
    at o (auth0-spa-js.production.esm.js:15:1023)
    at e.handleRedirectCallback (auth0-spa-js.production.esm.js:15:83283)
    at auth0-auth0-angular.js:484:21
    at Observable._subscribe (defer.js:5:18)
    at Observable._trySubscribe (Observable.js:37:1)

```

---

<div class="post-metadata">

**Author:** ![lonli.lokli](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lonli.lokli/32/35271_2.png) [@lonli.lokli](https://community.auth0.com/u/lonli.lokli)\
**Post date:** [April 2, 2022, 10:26pm UTC](https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014/2 "2022-04-02T22:26:16Z")

</div>

Never mind, I should set useCookiesForTransactions as parameters for AuthConfig

```auto
 AuthModule.forRoot({
      domain: 'YOUR_AUTH0_DOMAIN',
      clientId: 'YOUR_AUTH0_CLIENT_ID',
      useCookiesForTransactions: true
    }),

```

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 28, 2022, 11:21am UTC](https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014/3 "2022-04-28T11:21:35Z")

</div>

Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 28, 2022, 11:21am UTC](https://community.auth0.com/t/getting-invalid-state-with-sign-up-login-afterwards-works/81014/4 "2022-04-28T11:21:37Z")

</div>


