# Migrating to Universal Login from Lock

**URL:** <https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391>\
**Category:** Get Help\
**Tags:** migration, lock, login, universal-login\
**Created:** [February 24, 2021, 3:15am UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391 "2021-02-24T03:15:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruben1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ruben1/32/14206_2.png) [@ruben1](https://community.auth0.com/u/ruben1)\
**Post date:** [February 24, 2021, 3:15am UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391/1 "2021-02-24T03:15:29Z")

</div>

Hi!!  
So we were using the Lock authentication without problems for a couple of months but now we want to use the mobile version and decided the best bet was to migrate to Universal Login. We are using auth0-hooks and can successfully create new users. However, we are not able to handle user data correctly after log in.  
We read this issue

> [@Import auth0 issue - july 16 migration](https://community.auth0.com/t/import-auth0-issue-july-16-migration/12326):
>
> We are migrating from Auth0-Lock 10.x to Universal Login. Our stack is Node.js server and React client. Before, we used auth0-lock version 10.2.2: import Auth0Lock from ‘auth0-lock’ lock = new Auth0Lock(clientId, domain, cfg) Now, we are trying to use auth0-js version 9.6.1: const AuthenticationClient = require(‘auth0’).AuthenticationClient; var auth0Client = new AuthenticationClient({domain, clientId}); lock = new auth0Client.WebAuth() We get the webpack build error: ERROR in ./src/utils/…

and the documentation but I can’t find the complete guide on what we should do with these variables:  
this.lock = new Auth0Lock(props.clientId, props.domain, props.options);  
this.tokenRenewalTimeout = null;  
this.state = {  
lock: this.lock,  
login: this.login,  
logout: this.logout,  
isAuth: false  
};  
}

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 24, 2021, 8:51pm UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391/3 "2021-02-24T20:51:58Z")

</div>

Hi @ruben1,

Welcome to the Community!

Just to make sure I understand what you are looking to do, are you planning to migrate from an [embedded login](https://auth0.com/docs/universal-login/universal-vs-embedded-login) to Universal Login? Or are you migrating from the [Classic Universal Login Experience](https://auth0.com/docs/universal-login/classic-experience) to the [New Universal Login Experience](https://auth0.com/docs/universal-login/new-experience)?

---

<div class="post-metadata">

**Author:** ![ruben1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ruben1/32/14206_2.png) [@ruben1](https://community.auth0.com/u/ruben1)\
**Post date:** [February 24, 2021, 11:37pm UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391/4 "2021-02-24T23:37:24Z")

</div>

Hi! Yes, I want to migrate from embedded login to Universal Login. We had to change it to Universal since the embedded one wasn’t working on some mobile devices. I am using Next js and auth0-react-hooks. The log in and sign up are done correctly but we are unable to get the access token afterwards and use the session info.It seemed to be an easy process but it’s much harder than we thought. I found this previous issue that seemed to indicate we had to change the authlocks with webAuth.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 25, 2021, 8:40pm UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391/5 "2021-02-25T20:40:24Z")

</div>

I see! a new SDK was just released a couple of weeks abo specifically for Next.js. I’d suggest taking a look at the Next.js Quickstart if you haven’t already: [Auth0 Next.js SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/nextjs/01-login)

There is an example in the quickstart of retrieving an Access Token

```auto
import { getAccessToken, withApiAuthRequired } from '@auth0/nextjs-auth0';

export default withApiAuthRequired(async function shows(req, res) {
  try {
    const { accessToken } = await getAccessToken(req, res, {
      scopes: ['read:shows']
    });
    const apiPort = process.env.API_PORT || 3001;
    const response = await fetch(`http://localhost:${apiPort}/api/shows`, {
      headers: {
        Authorization: `Bearer ${accessToken}`
      }
    });
    const shows = await response.json();

    res.status(200).json(shows);
  } catch (error) {
    res.status(error.status || 500).json({ error: error.message });
  }
});

```

---

<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:** [March 18, 2021, 11:22am UTC](https://community.auth0.com/t/migrating-to-universal-login-from-lock/58391/6 "2021-03-18T11:22:34Z")

</div>

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