Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization without e-mail problem #487

Open
drazen64 opened this issue Dec 1, 2024 · 1 comment
Open

Authorization without e-mail problem #487

drazen64 opened this issue Dec 1, 2024 · 1 comment

Comments

@drazen64
Copy link

drazen64 commented Dec 1, 2024

Application is .Net 8, latest version.

I have a database of users migrated from the legacy application, where they had user names and passwords but no e-mails. Data is now in the AspNetCore.Identity tables.

I created a new project using:
dotnet new mudblazor --interactivity Auto --auth Individual --all-interactive

I made two changes in the project:

  • In program.cs the database is changed to Oracle.
  • In Login.razor InputModel class, I removed the e-mail verification attribute on the e-mail field.

When I run the application, the user can log in, but then strange things happen with the UI—on each interaction with the application, the user's status changes from authorized to not authorized.

A workaround/fix is to add a bogus e-mail to the user's entry in the database.

It looks like a null value in the UserInfo.Email creates problems.

The original MS Blazor template does not have this problem.

I have a workaround, but I'd like to know if checking e-mail for null can be made somewhere in the template.

@ScarletKuro
Copy link
Member

I'm not sure we can help you. Our templates are essentially a direct fork of the vanilla MS templates, with the Mud library and Mud components added. I'm not sure why it works for you in the original MS templates. I checked, and the auth state providers are the same, and I see there is a null check for the email. Perhaps I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants