# Lock not hitting lock.on after login

**URL:** <https://community.auth0.com/t/lock-not-hitting-lock-on-after-login/32569>\
**Category:** Get Help\
**Tags:** lock, login\
**Created:** [October 18, 2019, 9:22pm UTC](https://community.auth0.com/t/lock-not-hitting-lock-on-after-login/32569 "2019-10-18T21:22:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToastMasterson](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/toastmasterson/32/16872_2.png) [@ToastMasterson](https://community.auth0.com/u/ToastMasterson)\
**Post date:** [October 18, 2019, 9:22pm UTC](https://community.auth0.com/t/lock-not-hitting-lock-on-after-login/32569/1 "2019-10-18T21:22:58Z")

</div>

I’m using the lock widget for logging in, but the lock.on function to getUserInfo is never being hit, so nothing is being stored to localStorage.  
I feel like I’m simply missing something in the flow.  
Here is the code I’m currently working with for my LogIn component:

```
import React from 'react'
import { useAuth0 } from '../react-auth0-wrapper'
import { withRouter, Redirect } from 'react-router-dom'
import Auth0Lock from 'auth0-lock'

import '../style_sheets/LogIn.css'

const LogIn = () => {
    const { isAuthenticated } = useAuth0()

    var options = {
        theme: {
            logo: 'https://i.imgur.com/mQWWPgC.png',
            primaryColor: '#2975a6'
        },
        auth: {
            redirectUrl: 'http://localhost:3000/artisthome',
            responseType: 'token',
        },
        scope: "openid user_metadata",
        allowedConnections: ['GigMeSignup'],
        allowShowPassword: true,
        autofocus: true,
        
        allowSignUp: false
    }
    var lock = new Auth0Lock(
        '<ClientId>',
        '<Domain>', options
      )

    var Auth = (function() {

    var wm = new WeakMap();
    var privateStore = {};
    var lock;
    
    function Auth() {
        this.lock = new Auth0Lock(
        '<ClientId>',
        '<Domain>', options
        );
        wm.set(privateStore, {
        appName: "Gig-Me"
        });
    }
    
    Auth.prototype.getProfile = function() {
        return wm.get(privateStore).profile;
    };
    
    Auth.prototype.authn = function() {
        this.lock.on("authenticated", function(authResult) {
        this.getUserInfo(authResult.accessToken, function(error, profile) {
            if (error) {
            // Handle error
            return;
            }
    
            wm.set(privateStore, {
            accessToken: authResult.accessToken
            });
    
            wm.set(privateStore, {
            profile: profile
            });
    
        });
        });
    };
    return Auth;
    }());

    const Button = withRouter(({history}) => (
        <button
            className="button" 
            onClick={() => {history.push('/signup')}}>
            Sign Up
        </button>
    ))

    return (isAuthenticated
        ? <Redirect to="/artisthome"/>
        : <div className="log-in">
                <div className="headers">
                    <h4>Welcome To</h4>
                    <img className="login-logo" src="https://i.imgur.com/mQWWPgC.png" alt="logo" />
                </div>
                <div className="choices">
                    <button 
                    className="button"
                        onClick={() => lock.show()}
                    >
                        Log In
                    </button>
                    Or
                    <Button />
                </div>
            </div>
    )
}

export default LogIn

```

---

<div class="post-metadata">

**Author:** ![dvanbrunt1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dvanbrunt1/32/32345_2.png) [@dvanbrunt1](https://community.auth0.com/u/dvanbrunt1)\
**Post date:** [February 2, 2022, 4:35pm UTC](https://community.auth0.com/t/lock-not-hitting-lock-on-after-login/32569/2 "2022-02-02T16:35:59Z")

</div>

I’m also seeing this same issue.  
we’ve placed both these and only the `signup success` fires, while `authenticated` does **not** …

```auto
    lock.on('authenticated', (authResult) => {
      console.log('authenticated');
      lock.getUserInfo(authResult.accessToken, function (error, profile) {
        console.log({error, profile});
        if (error) return
        const { email, ...rest } = profile
      });
    })
    lock.on("signup success", () => {
      console.log('signup success');
    })

```
