How to correctly enable SMS or email MFA in post-login trigger

@tudor.smeu Can I enroll a user in an MFA type via the management API and also challenge them in the same action chain? Something like this (both are separate custom actions):

exports.onExecutePostLogin = async (event, api) => {
    // enroll user in factor with Management API if not already enrolled
}

exports.onExecutePostLogin = async (event, api) => {
    // challenge user
}

What i’m currently doing is this and I don’t think that the user context is being updated in the same method invocation:

exports.onExecutePostLogin = async (event, api) => {
    // enroll user in factor if not already enrolled
    // challenge user
}

I’m even tried to chain actions