# Auth0 10 Lock Not Hiding

**URL:** <https://community.auth0.com/t/auth0-10-lock-not-hiding/7470>\
**Category:** Get Help\
**Tags:** auth0-lock\
**Created:** [July 12, 2017, 8:25am UTC](https://community.auth0.com/t/auth0-10-lock-not-hiding/7470 "2017-07-12T08:25:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makarand](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Makarand](https://community.auth0.com/u/Makarand)\
**Post date:** [July 12, 2017, 8:25am UTC](https://community.auth0.com/t/auth0-10-lock-not-hiding/7470/1 "2017-07-12T08:25:19Z")

</div>

My problems started since Passworless Legacy Auth was taken off from Auth0.

Now We are Integrating, Auth0 Lock10 with AngularJS1.x,  
Have followed all the steps, Issue I am having is  
\*\*Auth0Lock is Not Hiding after Login, i have the option autoclose: true,  
\*\*

Auth0-Angular Also has a issues  
lock.interceptHash = function() { .. }  
has var hash = $location.hash();, but this has value is always an empty string,  
hence I had to have my own implemention.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 12, 2017, 10:29am UTC](https://community.auth0.com/t/auth0-10-lock-not-hiding/7470/2 "2017-07-12T10:29:26Z")

</div>

Can you please provide the specific versions of Lock and angular-lock you are using. Can you please also update your question with a code sample for your Lock initialisation.

---

<div class="post-metadata">

**Author:** ![Makarand](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Makarand](https://community.auth0.com/u/Makarand)\
**Post date:** [July 12, 2017, 12:18pm UTC](https://community.auth0.com/t/auth0-10-lock-not-hiding/7470/3 "2017-07-12T12:18:34Z")

</div>

Hi,  
Below are the details of the implmentation  
angular-lock - V2.0.2  
“auth0-js”: “^8.4.0”  
“auth0-lock” : “version”: “10.18.0”,

```
//Step1.Initialization Code
app.config(function (lockProvider) {
  // Initialization for the angular-auth0 library
    lockProvider.init({
        clientID: AUTH0_CLIENT_ID,
        domain: AUTH0_DOMAIN,
        options: {
          _idTokenVerification: false,
            autoclose: true,
              allowedConnections: 'facebook', 'linkedin']
        },
        loginState:'loginlock',
        auth: {
          responseType: 'token',
          redirect: false,
        }
    });
//Step2
app.run(function(lock,authService) {  
  // For use with UI Router
  console.log("intervice and onAutheticated called")
 //lock.interceptedHash()
  authService.interceptHash();  
})
//Step3 - Auth Service
//incertpedHash function is derived from Angular-Lock.js as , .hash() function 
//was not working there., we derive the params
interceptHash: function() {
            if (typeof auth0.WebAuth !== 'function') {
                throw new Error('Auth0.js version 8 or higher must be loaded');
            }
            $rootScope.$on('$locationChangeStart', function(event, location) {
                if (/id_token=/.test(location) || /error=/.test(location)) {
                    //this is a klugde to get the id_token out of the location
                    var p1 = $location.path().substring(1)
                    var url_string="http://www.example.com/t.html?"+p1
                    var url = new URL(url_string);
                    var idToken = url.searchParams.get("id_token");  
                    var auth0AccessToken = url.searchParams.get("access_token");  
                    event.preventDefault()                    
                    var authResult = {
                        id_token: idToken,
                        access_token : auth0AccessToken
                    }
                    lock.emit('authenticated', authResult);
                    invokePostLockTokenLogin(idToken,auth0AccessToken)                                  
                }
            });
        }
//step4 - invokePostLockToken
function invokePostLockTokenLogin(idToken,auth0AccessToken){
        localStorage.setItem(byConstants.ID_TOKEN, idToken);
        lock.getUserInfo(auth0AccessToken, function(error, profile) {
            if (!error) {
                var authData = {
                    token : idToken,
                    profileData : profile
               }
                $rootScope.$broadcast('event:auth0ProfileSet', authData);
            }else{
                $state.go('loginlock')
            }
        });
    }

//so even after successful login , Login Lock stays ethere

```

---

<div class="post-metadata">

**Author:** ![Makarand](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Makarand](https://community.auth0.com/u/Makarand)\
**Post date:** [July 13, 2017, 5:45am UTC](https://community.auth0.com/t/auth0-10-lock-not-hiding/7470/4 "2017-07-13T05:45:32Z")

</div>

Hi

Was able to figure out the issues, after redirect, it again calls the login, where I was doing lock.show, added a check to see if the access\_token is recieved, in that case do not call the lock.show 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/auth0-10-lock-not-hiding/7470/5 "2018-03-02T05:55:18Z")

</div>


