Skip to content

Commit

Permalink
Fix CORS origin.
Browse files Browse the repository at this point in the history
  • Loading branch information
from20020516 committed May 8, 2022
1 parent dcfe05f commit d177726
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amplify/backend/function/ExpressFunction/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dotenv.config()
const secret = process.env.app_secret as string

const app = express()
app.use(cors({ credentials: true, origin: true }))
app.use(cors({ credentials: true, origin: [/^https:\/\/[a-z0-9\.]+amplifyapp\.com$/] }))
app.use(passport.initialize())
app.use(session({ secret, saveUninitialized: false, resave: false }))
app.use(passport.session())
Expand Down

0 comments on commit d177726

Please sign in to comment.