0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(console): add dev origin to allowed CORS domain in OIDC (#397)

This commit is contained in:
Gao Sun 2022-03-16 16:35:45 +08:00 committed by GitHub
parent 305b6aefb9
commit bfc8a64c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,7 +91,9 @@ export default async function initOidc(app: Koa): Promise<Provider> {
clientBasedCORS: (_, origin) => {
console.log('origin', origin);
return origin.startsWith('http://localhost:3001');
return ['http://localhost:3001', 'https://logto.dev'].some((value) =>
origin.startsWith(value)
);
},
findAccount: async (ctx, sub) => {
await findUserById(sub);