Completes the OTP authentication flow by verifying the OTP code and then either signing up or logging in the user.
This function first verifies the OTP code for the provided contact and OTP type.
If the contact is not associated with an existing sub-organization, it will automatically create a new sub-organization and complete the sign-up flow.
If the contact is already associated with a sub-organization, it will complete the login flow.
Supports passing a custom public key for authentication, invalidating existing session, specifying a session key, and providing additional sub-organization creation parameters.