# Implementing a embedded login experience in a React App

**URL:** <https://community.auth0.com/t/implementing-a-embedded-login-experience-in-a-react-app/61238>\
**Category:** Get Help\
**Created:** [April 16, 2021, 11:25am UTC](https://community.auth0.com/t/implementing-a-embedded-login-experience-in-a-react-app/61238 "2021-04-16T11:25:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inayat-C](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/inayat-c/32/22080_2.png) [@Inayat-C](https://community.auth0.com/u/Inayat-C)\
**Post date:** [April 16, 2021, 11:25am UTC](https://community.auth0.com/t/implementing-a-embedded-login-experience-in-a-react-app/61238/1 "2021-04-16T11:25:13Z")

</div>

Hello,

As the title suggests, I have my own custom UI for a login form so I’ve identified that I can use the embedded login experience to authenticate users.

I’m using the auth0.js library and have managed to get something sort of working with this simple implementation:

```
const auth = new auth0.WebAuth({
    domain: 'param.domain',
    clientID: 'param.clientid',
    responseType: 'token id_token',
    redirectUri: 'http://localhost:3000',
});

auth.login(
    {
        realm: 'my-custom-db',
        email: userEmail,
        password: userPassword,
    },
);

```

This seems to somewhat work, I notice that I receive a cookie after successful authentication and also can see the authenticated user in the user tab of the auth0 dashboard.

My questions are:

1. Are there any methods within the library that will help me verify the authentication of the user between page loads in a SPA? How could this potentially be implemented as I wasn’t able to clearly find something in the docs?

2. I noticed that after a successful auth, the redirect uri is appended with some info such as access token and token type. Surely this shouldn’t be exposed in the URL and I’ve noticed that there seems to be a method called `parseHash` that can help with this but again, unclear through the docs on how to implement.

3. When a new user signs in for the first time, the app is redirected to a screen:

 ![Screenshot 2021-04-16 at 12.23.26](https://global.discourse-cdn.com/auth0/original/3X/8/f/8f5ee2dcf13d659d60b7f434e19b2cd928c7654b.jpeg)

Is there any way around stopping this?

Many thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 16, 2021, 8:52pm UTC](https://community.auth0.com/t/implementing-a-embedded-login-experience-in-a-react-app/61238/3 "2021-04-16T20:52:41Z")

</div>

Hi @Inayat-C,

Welcome back!

> [@Inayat-C](#):
>
> Are there any methods within the library that will help me verify the authentication of the user between page loads in a SPA? How could this potentially be implemented as I wasn’t able to clearly find something in the docs?

Have you looked at the [checkSession method](https://auth0.com/docs/libraries/auth0js#using-checksession-to-acquire-new-tokens)? 😃

> [@Inayat-C](#):
>
> I noticed that after a successful auth, the redirect uri is appended with some info such as access token and token type. Surely this shouldn’t be exposed in the URL and I’ve noticed that there seems to be a method called `parseHash` that can help with this but again, unclear through the docs on how to implement.

Auth0.js is an older implementation, and we don’t usually recommend using it (or embedded login for that matter).

> [@Inayat-C](#):
>
> When a new user signs in for the first time, the app is redirected to a screen:

[https://community.auth0.com/t/disable-authorize-app-dialogue-box/26050](https://community.auth0.com/t/disable-authorize-app-dialogue-box/26050)

There is a lot of information about most of these topics in the forum (embedded login in particular). You should find plenty of resources by utilizing the search function 😄 .

---

<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 1, 2021, 5:05pm UTC](https://community.auth0.com/t/implementing-a-embedded-login-experience-in-a-react-app/61238/4 "2021-06-01T17:05:13Z")

</div>

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