import ch.nevis.esauth.auth.engine.AuthResponse

def sess = request.getAuthSession(true)

if(inargs['cancelEid']){
    LOG.debug("Account registration canceled: Send response with error")
    response.setResult('cancel')
    return
}

if(inargs['continue'] == 'link_account'){
    LOG.debug("AGOV account linking")
    //sess.setAttribute("eid.placeholder.text", "EId: Implicit account linking not implemented yet")
    response.setResult('link')
    return
}

if(inargs['continue'] == 'register_account'){
    LOG.debug("AGOV account registration was selected")
    sess.setAttribute("eid.placeholder.text", "EId: Account registration with implicit linking not implemented yet")
    response.setResult('register')
    return
}

LOG.debug("Show GUI")
response.setStatus(AuthResponse.AUTH_CONTINUE)
return