diff --git a/packages/api/src/routers/auth/mobile/mobile_auth_router.ts b/packages/api/src/routers/auth/mobile/mobile_auth_router.ts index 7bd0c20e9..c43df9bc8 100644 --- a/packages/api/src/routers/auth/mobile/mobile_auth_router.ts +++ b/packages/api/src/routers/auth/mobile/mobile_auth_router.ts @@ -12,6 +12,8 @@ import { } from './sign_up' import { createMobileAccountCreationResponse } from './account_creation' import { env } from '../../../env' +import { corsConfig } from '../../../utils/corsConfig' +import cors from 'cors' export function mobileAuthRouter() { const router = express.Router() @@ -61,6 +63,12 @@ export function mobileAuthRouter() { res.status(payload.statusCode).json(payload.json) }) + // Required since this will be called from Android WebView + router.options( + '/android-apple-redirect', + cors({ ...corsConfig, maxAge: 600 }) + ) + router.post('/android-apple-redirect', (req, res) => { const { id_token } = req.body return res.redirect(