okay @prosto.duda I think I understand better now.
First let me say @senecadatabase suggestion would have been best. force them to login once the user tries to access the form (before the even begin filling the form). But if for some genuine reason, you still want to stick to your method, here is what you can do
Create 2 event when the user clicks on sumbit:
- event when user clicks on submit & current user is logged in - here you would just create and redirect.
- event when user clicks on submit & current user is not logged in -
a. Create different state on the signup/login component (each state would take the form input value) - that would transfer those values inside the signup/login flow
b. ensure that the submit button is unclickable unless the user fills all the form completely
c. when the login flow is complete, check (still inside the signup/login component) if all those values are not empty, if not, then trigger a custom event inside the signup/login component (create a custom event that has 2 actions. i.) creates the record from the signup/login component states and ii.) redirects the user. )
This should solve it for you.