Skip to content

Commit

Permalink
Add auth to allowed headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Oct 22, 2023
1 parent 4b667ed commit 4a5c7d7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function bootstrap() {
app.use(
cors({
credentials: true,
allowedHeaders: ['auth'],
origin: [
'https://localhost:3001',
'https://staging.pairwise.generalmagic.io',
Expand All @@ -38,6 +39,20 @@ async function bootstrap() {
}),
);

// app.use(function (req: any, res: any, next: any) {
// res.setHeader('Access-Control-Allow-Origin', '*');
// res.setHeader(
// 'Access-Control-Allow-Methods',
// 'GET, POST, OPTIONS, PUT, PATCH, DELETE',
// );
// res.setHeader(
// 'Access-Control-Allow-Headers',
// 'X-Requested-With,content-type',
// );
// res.setHeader('Access-Control-Allow-Credentials', true);
// next();
// });

// app.all('*', function (req, res) {
// res.header('Access-Control-Allow-Origin', '*');
// res.header(
Expand Down

0 comments on commit 4a5c7d7

Please sign in to comment.