masastack / MASA.Blazor

Blazor UI component library based on Material Design. Support Blazor Server, Blazor WebAssembly and MAUI Blazor.
https://docs.masastack.com/blazor/getting-started/installation
Other
1.2k stars 159 forks source link

add authentication and authorization to Masa.Template #2260

Open OmidAtaei1984 opened 5 days ago

OmidAtaei1984 commented 5 days ago

Hello. Please add authentication and authorization to Masa.Template, especially to blazor web app. Also, provide the ability to run blazor with https profile. In addition, if a program is created as a Blazor web app through dotnet new and its render mode is Server and its Interactive Mode is Global, then in forms related to authentication, such as login or register, if mform or mtextfield is used, it is not possible to use bind-value controls and an error occurs.Thanks

capdiem commented 5 days ago

@OmidAtaei1984 Thank you for reaching out. Currently, Masa.Template does not have a built-in authentication system for Blazor templates, but you can first create a project with authentication using the official dotnet CLI, and then update your project according to our documentation.

OmidAtaei1984 commented 5 days ago

Hi. I created a Blazor webapp according to the attached image and replaced the login form controls in the account section with Masa.Blazor controls. When submitting the form, an error message is displayed as shown in the attached image. It should be noted that MTextField and MCheckbox controls are also not working due to the login page has no interactivity mode. Screenshot_20241124_085921 Screenshot_20241124_114504 Screenshot_20241124_114538 Screenshot_20241124_114607 Screenshot_20241124_114651 Screenshot_20241124_114713 Screenshot_20241124_130914

capdiem commented 4 days ago

@OmidAtaei1984 I can reproduce your issue, but I cannot provide a suitable solution. The logic for assigning values to the input in MTextField relies on JavaScript rather than the value attribute, so it can only be used during interactions. We may change this logic at some point in the future, but not in the near term. For non-interactive forms, it's best to use the native form or the EditForm and its Input components provided by Blazor. The issue of inconsistent UI can only be resolved through custom CSS.