PostLoginAction throw error

What happens in the postLoginAction when we:

  1. Throw an error like this?
throw new Error("some failure");
  1. Return a command of type “deny”?
return {
       command: {
            type: "deny",
            reason: "some crazy reason!",
        }
    }

Will subsequent actions continue to execute in both cases?
Will the end-user always be redirected to the application page, or can the errors be propagated to the universal login-page?

Thanks for clarification.

Hi @alexab,

After some initial testing, it looks like other actions in the flow do not execute, but I am confirming this now. Thanks!

1 Like

I think I found the answer for the second question, i.e. the user will be redirected to the application page (it is after all called a powerLoginAction)

1 Like

I’ve confirmed that in both scenarios, a thrown exception will ALWAYS reject the login, meaning other actions in the flow should not run when an error is thrown or the deny command is used. And yes, the user will be redirected to the app with the error in both cases.

Note: After the general release of actions, it’s possible that throwing exceptions will no longer be used as the preferred control-flow mechanism like it was in rules. Denying access will likely look more like the second method or a new API method. More info to come with the general release!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.