JWT handler not working.
I am trying to get a login with a JWT authentication working. I have followed this video https://www.youtube.com/watch?v=GTXvMu6Ex-o&t=1215s .
The error I am getting is:
JavaScript interop calls cannot be issued at this time. This is because the component is being statically rendered. When prerendering is enabled, JavaScript interop calls can only be performed during the OnAfterRenderAsync lifecycle method.
The problem came when I tried to add the AuthenticationHandler.
This is a part of the handler:
This is the GetJwtAsync method.
Which gets called by the handler on this line
var jwt = await _authenticationServices.GetJwtAsync();
when debugging, the error gets after this line var jwt = await _authenticationServices.GetJwtAsync();
Coding Tutorials
YouTube
Blazor Authentication with JSON Web Tokens
We've seen a ASP.NET backend with an Angular frontend. What if we want C# all the way through? Here's how we do it in Blazor.
Source code available at: https://github.com/JasperKent/Blazor-Wasm-Authentication
Server code available at: https://github.com/JasperKent/WebApi-Authentication
Topics include:
- Creating HttpClient through an HttpClien...
0 Replies