# Smart actions not working after deployment

**URL:** <https://community.forestadmin.com/t/smart-actions-not-working-after-deployment/1912>\
**Category:** Help me!\
**Created:** [February 23, 2021, 2:57pm UTC](https://community.forestadmin.com/t/smart-actions-not-working-after-deployment/1912 "2021-02-23T14:57:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carosatig](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@carosatig](https://community.forestadmin.com/u/carosatig)\
**Post date:** [February 23, 2021, 2:57pm UTC](https://community.forestadmin.com/t/smart-actions-not-working-after-deployment/1912/1 "2021-02-23T14:57:06Z")

</div>

we are getting CORS errors while trying to run smart actions:

## Expected behavior

smart action should run

## Actual behavior

smart action not working

## Failure Logs

Access to XMLHttpRequest at ‘[https://backoffice.hectorkitchen.com/forest/actions/duplicate-flash-sale](https://backoffice.hectorkitchen.com/forest/actions/duplicate-flash-sale)’ from origin ‘[https://app.forestadmin.com](https://app.forestadmin.com)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

## Context

app.js extract

app.use(cors({  
allowedOrigins: [’\*.forestadmin.com’],  
headers: [‘Authorization’, ‘X-Requested-With’, ‘Content-Type’]  
}));

---

<div class="post-metadata">

**Author:** ![louis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/louis/32/4_2.png) [@louis](https://community.forestadmin.com/u/louis)\
**Post date:** [February 23, 2021, 3:53pm UTC](https://community.forestadmin.com/t/smart-actions-not-working-after-deployment/1912/2 "2021-02-23T15:53:57Z")

</div>

Hi @carosatig 👋

It looks like you are running on v3 of our liana.

Looking at our [upgrade note](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v3#cors-configuration), CORS configuration should be declared as follow:

```javascript
var express = require('express');
var cors = require('cors');

var app = express();

// ...

app.use(cors({
  origin: [/\.forestadmin\.com$/],
  allowedHeaders: ['Authorization', 'X-Requested-With', 'Content-Type'],
  credentials: true
}));

// ...

module.exports = app;

```

Adding `credentials: true` should help
