I’m working on an iOS app using SwiftUI and Firebase for user authentication. I have two types of users: individual users and organizations. I want to implement separate login and registration flows for each user type. Currently, I have a
SessionService that handles login/logout for individual users, and I’ve added an
orgSessionService for organizations. However, I’m facing difficulties in integrating the registration flow for organizations and ensuring that the correct home view is displayed based on the user type. Here’s an overview of my current implementation:
UserAccountManagementAppsets up the Firebase configuration and manages the
ContentViewchecks the login status of individual users using
sessionService.stateand displays the appropriate view.
- I have implemented the
OrgRegisterViewfor organization registration but need help connecting it to the correct session and ensuring the correct home view is displayed.
Could someone provide guidance on how to properly handle the registration flow for organizations, including the integration with the
orgSessionService , and ensure that the correct home view is displayed based on the user type? Any code examples or step-by-step explanations would be greatly appreciated. Thank you in advance for your help!
Here is the link to the project files: UserAccountManagement.xcodeproj - Google Drive