davidfowl / TodoApi

Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
MIT License
2.73k stars 409 forks source link

_Host in the Server project #72

Open famda opened 1 year ago

famda commented 1 year ago

Hey @davidfowl This project is awesome and helped me to learn a lot from it. I was walking through the code and I've noticed that, instead of the index.html you are using the _Host on the Server project.

Is there any reason for it? I noticed that there's no "loading" in it for that reason. 😀

PS: I don't care about the loading. I'm interested on what's the reason behind it.

davidfowl commented 1 year ago

This is why. The social providers are statically rendered from the server into the page.

famda commented 1 year ago

I see. I was looking into the blazor docs and this and thinking in a way to add authorization into the pages.

But I need to read more about this. Mainly because of that CurrentUser being rendered like that.

I need to think a little more.. 😆

Thanks man!

famda commented 1 year ago

After reading some more, the only way the Authorization part in the client project would work is to create a custom AuthorizationStateProvider to handle this. After some tries I'm was not yet able to make it to work. @davidfowl am I thinking wrong? Would you provide some guidance on this?

davidfowl commented 1 year ago

@famda What are you trying to do? Use auth on the WASM side?

famda commented 1 year ago

Hey @David,

Yes. Basically, I've created a AuthorizationStateProvider to handle the authorization on the wasm side. But my implementation looks a little crappy.. 😆