Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4275

Blazor redirect not working on mobile (iOS & Android) after user registration, but works on desktop

$
0
0

I created an app that you can view for context: fitsked.net. When registering on a laptop, the registration works fine. When registering on mobile (Chrome or Safari), the registration fails. Pause. The thing that actually isn't working is the registration confirmation. I know this because, when clicking "register" on mobile, the user registration data gets saved into the database. However, as you can see for yourself, the mobile version will direct you back to the home page instead of the "confirm account" page seen when registering on a laptop. Since you can't confirm your account on mobile, you can't login. Don't worry about the UX, I know this way of confirming an account is terrible.

When using Developer Tools on my laptop and choosing "iPhone SE" dimension or similar, the registration works. It doesn't work on iOS hardware - it doesn't work on Android hardware. I've verified on both. I swore this was at some point working during development. I can go back through my commits and see if it was ever working through trial and error, but would much rather just track down the actual problem.

I added logging to the app so that it would show up on the logs of my EC2 instance. As you can see, there is supposed to be a redirection to "Account/RegisterConfirmation." The following snippet is located in the app's Register.razor page.

if (UserManager.Options.SignIn.RequireConfirmedAccount)    {        Logger.LogInformation("RequireConfirmedAccount must have been true. Did you use a laptop to login?");        RedirectManager.RedirectTo("Account/RegisterConfirmation",            new() { ["email"] = Input.Email, ["returnUrl"] = ReturnUrl });    }    else    {        Logger.LogInformation("RequireConfirmedAccount must have been false. Did you just try to register with iPhone?");    }

I figured this method wasn't being called when registering from my phone. That's not the case. When registering on both my phone and laptop, I get "RequireConfirmedAccount must have been true. Did you use a laptop to login?" Therefore, I'm thinking it's got to be something with RedirectManager. Ultimately, I guess there must be like a fall back to the Home page for when the Account/RegisterConfirmation page is blocked?

Lastly, I've tried to track down the issue on iPhone by connecting it to my MacBook through the USB cable. This way I can use Developer Tools for Safari on the iPhone. I've looked at Console tab for errors and Network tab for any other routing-related errors. Am I looking in the right place? Any direction? Any suggestions on how I could debug something like this in the cloud using breakpoints? Thank you.


Viewing all articles
Browse latest Browse all 4275

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>