refactor: changes to allow async registration/authentication via third-party callback