# Error during callback handling: d: Invalid state

**URL:** <https://community.auth0.com/t/error-during-callback-handling-d-invalid-state/168483>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [January 13, 2025, 3:54pm UTC](https://community.auth0.com/t/error-during-callback-handling-d-invalid-state/168483 "2025-01-13T15:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbonam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bbonam/32/66805_2.png) [@bbonam](https://community.auth0.com/u/bbonam)\
**Post date:** [January 13, 2025, 3:54pm UTC](https://community.auth0.com/t/error-during-callback-handling-d-invalid-state/168483/1 "2025-01-13T15:54:08Z")

</div>

Hi Team, after login from Auth0 i am redirecting back to /callback component where private handleCallback(): void {  
this.auth  
.handleRedirectCallback() // Handle Auth0 callback  
.pipe(  
switchMap(() =\> this.auth.user$), // Fetch user profile  
tap((profile) =\> this.handleUserProfile(profile)), // Process user profile  
switchMap(() =\> this.loadConfig()), // Load configuration  
tap(() =\> this.login()), // Proceed to login  
catchError((err) =\> {  
console.error(‘Error during callback handling:’, err);  
this.setLoginError(‘An error occurred during login.’);  
return of(null); // Graceful continuation  
})  
)  
.subscribe();  
}

---

<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 13, 2025, 6:07pm UTC](https://community.auth0.com/t/error-during-callback-handling-d-invalid-state/168483/3 "2025-01-13T18:07:54Z")

</div>

Hi @bbonam,

Welcome to the Auth0 Community!

Can you kindy review this Knowledge Article we have on this error: [Invalid State Errors on handleRedirectCallback - Auth0 React SDK](https://community.auth0.com/t/invalid-state-errors-on-handleredirectcallback-auth0-react-sdk/148165)

Additoinally, could you provide a screenshot or paste the exact error message received? Do you see any failing logs in the tenant? Are you using classic login?

Thanks,

Mary Beth

---

<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:** [January 27, 2025, 6:08pm UTC](https://community.auth0.com/t/error-during-callback-handling-d-invalid-state/168483/4 "2025-01-27T18:08:43Z")

</div>

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