# Auth0-lock how to handle redirection without popup in SPA

**URL:** <https://community.auth0.com/t/auth0-lock-how-to-handle-redirection-without-popup-in-spa/108751>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [June 7, 2023, 12:11pm UTC](https://community.auth0.com/t/auth0-lock-how-to-handle-redirection-without-popup-in-spa/108751 "2023-06-07T12:11:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rendez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rendez/32/47886_2.png) [@rendez](https://community.auth0.com/u/rendez)\
**Post date:** [June 7, 2023, 12:11pm UTC](https://community.auth0.com/t/auth0-lock-how-to-handle-redirection-without-popup-in-spa/108751/1 "2023-06-07T12:11:07Z")

</div>

Dear Community,

I am trying to use the auth0-lock SDK and I understand that without leaving the SPA where the “popup” shows for login/signup, I can use the `.on("authenticated")` event after the redirection, but I want a full redirect, leaving my SPA, hence specifying the option auth.redirectUrl. Once I am redirected with search params `code` and `state`, how do I handle the authentication on the client? Where do I handle code and state to get an access\_token? Is this possible at all?

---

<div class="post-metadata">

**Author:** ![rendez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rendez/32/47886_2.png) [@rendez](https://community.auth0.com/u/rendez)\
**Post date:** [June 7, 2023, 12:13pm UTC](https://community.auth0.com/t/auth0-lock-how-to-handle-redirection-without-popup-in-spa/108751/2 "2023-06-07T12:13:32Z")

</div>

I just hit the nail in the coffin, I passed `responseType: "token"`, and now the `authenticated` callback works.

---

<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:** [June 21, 2023, 12:14pm UTC](https://community.auth0.com/t/auth0-lock-how-to-handle-redirection-without-popup-in-spa/108751/3 "2023-06-21T12:14:14Z")

</div>

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