TodoApi icon indicating copy to clipboard operation
TodoApi copied to clipboard

_Host in the Server project

Open famda opened this issue 1 year ago • 5 comments

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.

famda avatar Apr 05 '23 20:04 famda

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

davidfowl avatar Apr 05 '23 20:04 davidfowl

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 avatar Apr 05 '23 21:04 famda

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?

famda avatar Apr 06 '23 15:04 famda

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

davidfowl avatar May 15 '23 06:05 davidfowl

Hey @David,

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

famda avatar May 15 '23 06:05 famda