adn-agov-iam-project/patterns/db4acd487dc7e8b82de8abb4_sc.../handleCodeParameter.groovy

25 lines
863 B
Groovy

import ch.nevis.esauth.auth.engine.AuthResponse
if (inargs['cancel'] == 'cancel') {
//cleanSession()
response.setStatus(AuthResponse.AUTH_ERROR)
response.setTransferDestination('/SAML2/SSO/')
response.setIsRedirectTransfer(true)
return
}
if (inargs['cd'] == null && session['agov.recovery.code'] == null) {
response.setNote('lasterror', '9901')
response.setNote('lasterrorinfo', 'valid on-boarding link required')}
if (inargs['cd'] != null) {
//cleanSession()
response.setSessionAttribute('agov.recovery.code', inargs['cd'])
response.setStatus(AuthResponse.AUTH_CONTINUE)
response.setTransferDestination('/AUTH/RECOVERY/')
response.setIsRedirectTransfer(true)
return
}
if (inargs['cd'] == null && session['agov.recovery.code'] != null) {
response.setResult('exit.1')
return
}