Run custom logic before send actual request to OktaAPI

Hi Team,

My team is using Okta embedded view for authentication. I have a scenario to run some custom logic before sending an actual request to Okta login/forgot/unlock account API.

I found on Registration there are hooks like preSubmit, postSubmit etc. But did’nt found the same thing for others (login/forgot/unlock).

Is it possible to add that logic and if that logic returns success than only send API requests to Okta.

Thanks in advance for any help.


Please review hooks. Does it work for you ?

Thanks @gpadma , I’m trying these hooks are getting attached in oktaSignIn(I can see while inspecting) but are not called when performing any action.
I have attached many of them like this but any of these is not called. while I click of buttons.

signIn.before('identify-recovery', async () => {
                        console.log('before Forgot password');

In docs it is mentioned Hooks: Asynchronous callbacks can be invoked **before or after a specific view is rendered**.. In my case, I would need hooks on preSubmit.
Can you please confirm if those hooks will work for that case?