Closed eanpr closed 4 years ago
Sorry, I can't help you due to I could not understand what happens in your app.
Anyway, depending on your post, it seems a general problem on the Blazor WebAssembly app, not an issue of this package.
I recommend that you should ask to "stakoverflow" (https://stackoverflow.com/questions/tagged/blazor ) with disclosing your source code.
P.S. By the way, this package will work fine regardless of whether you are logged in or not.
See also the Blazor WebAssembly app below.
(On this app, you can change the language from the footer of this app before you logged in.)
i have the same issue, i use asp.net core authentication and if you are not logged AccessTokenNotAvailableException is raised when call GetTextTableAsync
@jsakamoto can we have support on this issue? with this problem the library is not usable with default asp.net core authentication identity server and jwt.
Thanks
@Gambero81
Could you help me by attaching the zip packaged project file which can reproduce your problem?
I have created a new Blazor WebAssembly App from Visual Studio template with this settings:
I have installed the i18nText package with nuGet, added service in Main and ConfigureServices methods and edited the Index.razor page as follow:
when i run the application the page load without translation and in devtools console return AccessTokenNotAvailableException after the json get request
This is the project:
Thank you very much @jsakamoto
@Gambero81 @eanpr Hi, everyone.
As I expect, the problem is not the "i18n text" package itself' s problem.
The most fundamental cause is, the default implementation is configured to try to attach access token all HTTP requests even if the request URL is allowed to anonymous access.
Therefore, I changed the code to attach access token to only HTTP requests to the limited specified URL.
I attach my solution as below.
The zip file includes local git repository, so you can see the change log.
I hope this my solution is helpful for you.
P.S. Really appreciate for you, @Gambero81 ! You sent to me the detail of the project to reproduce the problem. This was very very helpful for me to work on this problem, and save my time. Thanks!
@Gambero81 @eanpr Hi, everyone.
Today, I published v.9.1 package.
This version improved to works fine out of the box even on an access token-based authorization enabled site.
Thanks for your contribution! 👍
Hi, I use this package in blazor web assembly. If I am not login my application render error. but after after I login it working perfect.
Can you help me how to fix this? Thank