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

if (inargs['reason']) {
  response.setSessionAttribute('agov.recovery.reason', '' + inargs['reason'])
}

if (inargs['cancel'] && inargs['cancel'] == 'cancel') {
  def s = request.getAuthSession(true)
  s.removeAttribute('agov.recovery.moreThanOneLf')
  s.removeAttribute('agov.recovery.reason')

  response.setResult('doCancel')
  return
}

if (inargs['continue'] && inargs['continue'] == 'yes') {
  response.setResult('validReasons')
  return
}

if (inargs['continue'] && inargs['continue'] == 'no') {
  response.setResult('invalidReasons')
  return
}

// if we reach this, display the GUI again
response.setStatus(AuthResponse.AUTH_CONTINUE)
return