mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
set cors config for android web redirect
This commit is contained in:
parent
3d16b1d0b4
commit
a720d5a5d5
1 changed files with 8 additions and 0 deletions
|
|
@ -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<express.Request>({ ...corsConfig, maxAge: 600 })
|
||||
)
|
||||
|
||||
router.post('/android-apple-redirect', (req, res) => {
|
||||
const { id_token } = req.body
|
||||
return res.redirect(
|
||||
|
|
|
|||
Loading…
Reference in a new issue