The solution contains Maui hybrid and Blazor Server apps, each equipped with user authorization functionalities. Additionally, it includes a shared Razor component library that encompasses layouts, pages, and components.
The aim of this solution is to maximize code reuse across both applications by utilizing layouts, pages, and components. Efforts have been made to keep the Maui Blazor app and the Blazor Server app as "thin" as possible by consolidating shared code in the Razor component library. Since Maui Blazor operates on both Desktop and Mobile platforms, while Blazor Server operates within a browser, there were challenges in implementing a shared login page that could authenticate users from either Desktop/Mobile or a Web Browser. To address this, the AuthenticationStateProvider is utilized for authorizing users in Maui (Desktop and Mobile), while web users are authenticated with cookies. Additionally, to persist user authorization in Desktop/Mobile, user information has been stored in the Preference storage on the devices.
Log in with the following hardcoded email: "test@test.com" and any password. Note, only user authorization has been added and not user authentication.
- User authorization (Login/Logout)
- Show user email
- Toggle Darkmode