# Auth0 JS - signupAndAuthorize not logging in?

**URL:** <https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [January 15, 2025, 3:30am UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695 "2025-01-15T03:30:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![00dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/00dev/32/60297_2.png) [@00dev](https://community.auth0.com/u/00dev)\
**Post date:** [January 15, 2025, 3:30am UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/1 "2025-01-15T03:30:51Z")

</div>

Hey! I have used signupAndAuthorize, it logs in the user and returns what is needed but when I invoke checkSession shortly after it returns with an error `login_required`

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 15, 2025, 2:57pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/3 "2025-01-15T14:57:50Z")

</div>

Hi @00dev,

Welcome to the Auth0 Community!

Please see these two links for what to do when the `login_required` error is returned:

- [Massive Failed Silent Authentication (FSA) Logs with "Login required" Error](https://community.auth0.com/t/massive-failed-silent-authentication-fsa-logs-with-login-required-error/117855)
- [Silent Authentication Error Responses](https://auth0.com/docs/authenticate/login/configure-silent-authentication#error-responses)

Let me know if you have any additional questions!

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![00dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/00dev/32/60297_2.png) [@00dev](https://community.auth0.com/u/00dev)\
**Post date:** [January 15, 2025, 4:10pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/4 "2025-01-15T16:10:03Z")

</div>

Hey, None of these seem to be my issue because the silent auth works perfectly after login it only happens with signupAndAuthorize

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 15, 2025, 4:11pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/5 "2025-01-15T16:11:07Z")

</div>

Hi @00dev,

Thanks for your reply! Can you kindly provide a screenshot or code snippet of the `signupAndAuthorize` implementation?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![00dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/00dev/32/60297_2.png) [@00dev](https://community.auth0.com/u/00dev)\
**Post date:** [January 15, 2025, 6:24pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/6 "2025-01-15T18:24:49Z")

</div>

Here you go, I am only using localstorage for test purposes.

```auto
webAuth.signupAndAuthorize(
        {
          connection: 'Username-Password-Authentication',
          email,
          password,
          user_metadata: { phone },
        },
        (err, result) => {
          if (err) {
            console.error('Signup error:', err);
            let errorMessage = err.message || err.description || 'Something went wrong, please try again later.';
            showErrorPopup(errorMessage);
            
            toggleButtonState(form, false);
            return;
          }

          console.log('Signup success:', result);

 
          const { accessToken, idToken } = result;

          if (!accessToken || !idToken) {
            console.error('Missing tokens in the signupAndAuthorize result.');
            alert('Signup succeeded, but login failed to generate tokens.');
            return;
          }
    
   
          localStorage.setItem('access_token', accessToken);
          localStorage.setItem('id_token', idToken);

          window.location.href = '/home';
        }
      );

```

---

<div class="post-metadata">

**Author:** ![00dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/00dev/32/60297_2.png) [@00dev](https://community.auth0.com/u/00dev)\
**Post date:** [January 21, 2025, 4:50pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/7 "2025-01-21T16:50:10Z")

</div>

Hey, Still waiting on a reply from the implementation.

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 30, 2025, 7:11pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/8 "2025-01-30T19:11:32Z")

</div>

Hi @00dev,

Apologies for the delay here.

When calling `checkSession()`, the browser **must** have third-party cookies enabled. Otherwise, `checkSession()` is unable to access the current user’s session (making it impossible to obtain a new token without displaying anything to the user). The same will happen if users have [Safari’s ITP enabled](https://auth0.com/docs/troubleshoot/authentication-issues/renew-tokens-when-using-safari).

Do you have third-party cookies enabled on your browser or have ITP enabled on Safari?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![00dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/00dev/32/60297_2.png) [@00dev](https://community.auth0.com/u/00dev)\
**Post date:** [February 7, 2025, 8:11pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/10 "2025-02-07T20:11:01Z")

</div>

Hey,

Yeah, I do have third party cookies enabled. `checkSession()`, works fine. Only facing the issue with `signupAndAuthorize`

---

<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:** [February 21, 2025, 8:11pm UTC](https://community.auth0.com/t/auth0-js-signupandauthorize-not-logging-in/168695/11 "2025-02-21T20:11:41Z")

</div>

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