During application setup in auth0 dashboard, auth middleware from 'express-openid-connect
library automatic set a /login page in my API.
But i dont want to use this Standard auth0 login page. I want to use my own login page and connect it with Database Authentication - Then, after my login, if mfa is required, i want to be redirected to Auth0 MFA page.
How can i do this?
router.post('/token', limiter, oauth2Validations.validateCreateToken, (req, res) => {
const authInfo = _.clone(req.body)
const ip = req.ip
authInfo.ip = ip.split(',')[0]
if (!req.oidc.isAuthenticated()) {
return res.oidc.login({
authorizationParams: {
connection: 'Username-Password-Authentication',
},
})
}
usersApp
.oauth2PasswordAuth(authInfo, res)
.then((payload) => {
res.status(200).json(payload)
})
.catch((err) => {
processError(res, err)
})
})
I would like to use this route, but when i try to connect with database, i receive a cors error in auth0 /authorize route