# Implementing a custom login - avoiding the "auth0 is not defined" error

**URL:** <https://community.auth0.com/t/implementing-a-custom-login-avoiding-the-auth0-is-not-defined-error/6274>\
**Category:** Get Help\
**Tags:** angular2, custom-login\
**Created:** [April 19, 2017, 3:09pm UTC](https://community.auth0.com/t/implementing-a-custom-login-avoiding-the-auth0-is-not-defined-error/6274 "2017-04-19T15:09:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ubrezic](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ubrezic](https://community.auth0.com/u/ubrezic)\
**Post date:** [April 19, 2017, 3:09pm UTC](https://community.auth0.com/t/implementing-a-custom-login-avoiding-the-auth0-is-not-defined-error/6274/1 "2017-04-19T15:09:33Z")

</div>

I got auth0 working on my angualr2 application with webpack by replacing

```
declare var auth0: any;

```

in the auth.service.ts with

```
let Auth0Lock = require('auth0-lock').default;

```

This allowed me to avoid the “auth0 is not defined” error and everything functioned correctly.

I am now trying to implement custom login. I used the code from the quickstart but replacing the “declare var auth0: any;” messes with the “//Configure Auth0” part of the code.

```
let Auth0Lock = require('auth0-lock').default;

@Injectable()
export class Auth {

  // Configure Auth0
  auth0 = new auth0.WebAuth({
    domain: myConfig.domain,
    clientID: myConfig.clientID,
    redirectUri: myConfig.callbackURL,
    responseType: 'token id_token'
  });

```

I’m guessing I need to replace the “//Configure Auth0” part with

```
lock = new Auth0Lock('myConfig.domain', 'myConfig.clientID', {});

```

and also define the redirectUrl and responseType in this line.

Can someone tell me how I should go about doing this?

---

<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:53am UTC](https://community.auth0.com/t/implementing-a-custom-login-avoiding-the-auth0-is-not-defined-error/6274/2 "2018-03-02T05:53:21Z")

</div>


