# Lock - Error following tutorial

**URL:** <https://community.auth0.com/t/lock-error-following-tutorial/7772>\
**Category:** Get Help\
**Tags:** angular, lock\
**Created:** [August 7, 2017, 6:15pm UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772 "2017-08-07T18:15:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![l.testa](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@l.testa](https://community.auth0.com/u/l.testa)\
**Post date:** [August 7, 2017, 6:15pm UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772/1 "2017-08-07T18:15:17Z")

</div>

I am sorry for asking something so basic.  
I already configured Auth0 login page, but now I want to use Lock to make my login page to look better (background color, icon, etc).

I installed libraries with NPM, but I’m not sure where to place the code. I pasted it into ngOnInit() from app.component.ts:

```
// Initiating our Auth0Lock
var lock = new Auth0Lock(
  'uBlBflc6sqa0FHLV_sScVo2j99wSTM6J',
  'leoboatjump.eu.auth0.com'
);

// Listening for the authenticated event
lock.on("authenticated", function(authResult) {
  // Use the token in authResult to getUserInfo() and save it to localStorage
  lock.getUserInfo(authResult.accessToken, function(error, profile) {
    if (error) {
      // Handle error
      return;
    }

    localStorage.setItem('accessToken', authResult.accessToken);
    localStorage.setItem('profile', JSON.stringify(profile));
  });
});

```

Also the rest of code from tutorial…

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [August 8, 2017, 3:59pm UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772/2 "2017-08-08T15:59:37Z")

</div>

You can customize the Lock used by default in the hosted login page, you don’t need to use Lock embedded directly in the client application in order to customize it’s appearance. The Lock customization options are documented [here](https://auth0.com/docs/libraries/lock/v10/ui-customization) and the process to customize the hosted login page is documented [here](https://auth0.com/docs/hosted-pages/login).

If you still want to go the embedded login route then both [Angular.js](https://auth0.com/docs/quickstart/spa/angularjs) and [Angular](https://auth0.com/docs/quickstart/spa/angular2) quickstarts have a link to a corresponding embedded login sample if you scroll all the way down in the _Login_ step of each quickstart. The samples should give you a better idea on how to use Lock within the client application itself; although that has some constraints, hence the hosted login page would be the recommendation.

---

<div class="post-metadata">

**Author:** ![l.testa](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@l.testa](https://community.auth0.com/u/l.testa)\
**Post date:** [August 8, 2017, 6:02pm UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772/3 "2017-08-08T18:02:49Z")

</div>

I have solved it:

-First, I stopped using Auth0 Basic and Auth0 Lock at same time, now I have only Lock in my code.

-Second, I used `import Auth0Lock from "auth0-lock";` instead of `import { Auth0Lock } from 'auth0-lock';` .

Thanks to all for your help and attention.

---

<div class="post-metadata">

**Author:** ![l.testa](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@l.testa](https://community.auth0.com/u/l.testa)\
**Post date:** [August 8, 2017, 6:04pm UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772/4 "2017-08-08T18:04:25Z")

</div>

Thanks very much.

Can you tell me how to change icon?

I tried but… it didn’t change.

Thanks again.

---

<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 2, 2018, 5:55am UTC](https://community.auth0.com/t/lock-error-following-tutorial/7772/5 "2018-03-02T05:55:48Z")

</div>


