From: users [mailto:[hidden email]] On Behalf Of Cantor, Scott
Sent: Tuesday, 28 January 2020 12:07
To: Shib Users <[hidden email]>
Subject: Re: early exit from Nashorn script?
On Mon, Jan 27, 2020 at 7:00 PM Jim Fox <[hidden email]> wrote:
> Every Nashorn script I've seen ends with its return value, e.g.,
> "nextFlow;" in mfa scripts. Is there a way to exit with a value in the
> middle of the script?
> # I know user cannot complete the login
This is a dev question but...
blessing and a curse). In this case, you probably want to adopt the
functional style and write a self-executing anonymous function 
have multiple return statements so you can short-circuit function
execution under various conditions as desired.
There are examples of self-executing anonymous functions in the wiki.
Taking a step back, if the scope of this question is purely "How to do I exit MFA script properly?"
The rules of the MFA script dictate that you exit an MFA subscript with one of two options: "name of the next flow to execute" or null.
If you want to "do something", you can either make the script log a line using built in logger, call some custom authn/foo flow you created, call some built-in authn/flow, or exit with null.