# On the Gatsby project, .on event is not getting fired on production site

**URL:** <https://community.auth0.com/t/on-the-gatsby-project-on-event-is-not-getting-fired-on-production-site/45507>\
**Category:** Get Help\
**Tags:** gatsbyjs, lock\
**Created:** [June 30, 2020, 5:50am UTC](https://community.auth0.com/t/on-the-gatsby-project-on-event-is-not-getting-fired-on-production-site/45507 "2020-06-30T05:50:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynosapp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dynosapp/32/13900_2.png) [@dynosapp](https://community.auth0.com/u/dynosapp)\
**Post date:** [June 30, 2020, 5:50am UTC](https://community.auth0.com/t/on-the-gatsby-project-on-event-is-not-getting-fired-on-production-site/45507/1 "2020-06-30T05:50:19Z")

</div>

Hello,  
I am trying to get Auth0-Lock working on our Gatsby site. It works great on the local. However, after publishing the site, it is not redirecting.  
Essentially, what we found was it is not firing the `lock.on('authenticated', function(authResult) {...`.  
We followed the instructions from the blog post ([How to Secure GatsbyJS Sites with Auth0 for Authentication](https://auth0.com/blog/securing-gatsby-with-auth0/)) and created this repo with our modifications: [https://github.com/GreenOn/auth0-lock-gatsby](https://github.com/GreenOn/auth0-lock-gatsby).

And here is the hosted site: [http://gatsby-auth0-lock-test.s3-website.us-east-2.amazonaws.com/](http://gatsby-auth0-lock-test.s3-website.us-east-2.amazonaws.com/).  
We tried all kinds of things, but unable to get our site redirected. Could anyone take a look and help, please?  
Thanks!  
Pramod

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 30, 2020, 1:08pm UTC](https://community.auth0.com/t/on-the-gatsby-project-on-event-is-not-getting-fired-on-production-site/45507/2 "2020-06-30T13:08:26Z")

</div>

A post was merged into an existing topic: [Securing Gatsby with Auth0](https://community.auth0.com/t/securing-gatsby-with-auth0/24389)

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 30, 2020, 1:08pm UTC](https://community.auth0.com/t/on-the-gatsby-project-on-event-is-not-getting-fired-on-production-site/45507/3 "2020-06-30T13:08:27Z")

</div>


