# Auth0 working locally but not on development or production server

**URL:** <https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850>\
**Category:** Get Help\
**Created:** [January 7, 2021, 11:27pm UTC](https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850 "2021-01-07T23:27:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![achempak](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/achempak/32/26748_2.png) [@achempak](https://community.auth0.com/u/achempak)\
**Post date:** [January 7, 2021, 11:27pm UTC](https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850/1 "2021-01-07T23:27:16Z")

</div>

Hi,

I’m new to using auth0 (and the auth process in general). I’m working on an application using nextjs, express, and node. I’ve followed the express/node tutorial and successfully got authentication and authorization (using the authorization-extension) to work locally. However, when I deploy to my development/production server on Vercel, neither authentication nor authorization work.

In `app.js` I have the following:

```auto
const { auth } = require('express-openid-connect');
const server = express();

const config = {
  authRequired: true,
  auth0Logout: true,
  secret: process.env.AUTH0_SECRET,
  baseURL: process.env.HOST_URL,
  clientID: process.env.AUTH0_CLIENT_ID,
  issuerBaseURL: process.env.AUTH0_BASE_URL
};

server.use(auth(config));

// Other middleware

const app = next.boot(server);

```

The only difference on my local and my server is the value of ` process.env.HOST_URL`. In the application settings on the auth0 website I’ve added `HOST_URL/callback` as a callback URL and `HOST_URL` as a logout url.

The expected behavior is for the user to initially be redirected to `AUTH0_BASE_URL` upon accessing `HOST_URL`. If they login and don’t have the `admin` role, then they’ll be denied access on to any route (this works locally). If they login and do have the `admin` role, then they’ll have access to all routes.

The actual behavior is that the user is not redirected to `AUTH0_BASE_URL`, and they automatically have access to everything. Are their additional changes I need to make when deploying on my server?

---

<div class="post-metadata">

**Author:** ![achempak](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/achempak/32/26748_2.png) [@achempak](https://community.auth0.com/u/achempak)\
**Post date:** [January 11, 2021, 12:27am UTC](https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850/2 "2021-01-11T00:27:28Z")

</div>

Solved this. Vercel is incompatible with Express. The issue is unrelated to auth0.

---

<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:** [January 11, 2021, 9:05am UTC](https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850/3 "2021-01-11T09:05:47Z")

</div>

Thanks for sharing that with the rest of community!

---

<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:** [January 26, 2021, 9:05am UTC](https://community.auth0.com/t/auth0-working-locally-but-not-on-development-or-production-server/55850/4 "2021-01-26T09:05:54Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
