fixing error in local
This commit is contained in:
parent
95dd66eda3
commit
a623eee564
1 changed files with 10 additions and 1 deletions
11
sso.js
11
sso.js
|
|
@ -25,7 +25,16 @@ const signOptions = {
|
||||||
const urlKeycloakToken = `${process.env.KC_URL}/realms/${process.env.KC_REALMS}/protocol/openid-connect/token`;
|
const urlKeycloakToken = `${process.env.KC_URL}/realms/${process.env.KC_REALMS}/protocol/openid-connect/token`;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(cors({ origin: '*', methods: 'GET,POST,PUT,DELETE' }));
|
|
||||||
|
// Allow a specific origin and enable credentials
|
||||||
|
const corsOptions = {
|
||||||
|
origin: 'http://localhost:3002', // Replace with your Vue app's URL
|
||||||
|
methods: 'GET,POST,PUT,DELETE',
|
||||||
|
credentials: true, // Enable cookies or Authorization headers
|
||||||
|
};
|
||||||
|
|
||||||
|
app.use(cors(corsOptions));
|
||||||
|
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue