diff --git a/Oqtane.Client/Modules/Controls/FileManager.razor b/Oqtane.Client/Modules/Controls/FileManager.razor index f75d8f29d..a52f359e7 100644 --- a/Oqtane.Client/Modules/Controls/FileManager.razor +++ b/Oqtane.Client/Modules/Controls/FileManager.razor @@ -359,12 +359,6 @@ } if (restricted == "") { - if (!ShowProgress) - { - _uploading = true; - StateHasChanged(); - } - try { // upload the files @@ -374,7 +368,21 @@ if (PageState.Runtime == Shared.Runtime.Hybrid) { jwt = await UserService.GetTokenAsync(); + if (string.IsNullOrEmpty(jwt)) + { + await logger.LogInformation("File Upload Failed From .NET MAUI Due To Missing Security Token. Token Options Must Be Set In User Settings."); + _message = "Security Token Not Specified"; + _messagetype = MessageType.Error; + return; + } } + + if (!ShowProgress) + { + _uploading = true; + StateHasChanged(); + } + await interop.UploadFiles(posturl, folder, _guid, SiteState.AntiForgeryToken, jwt); // uploading is asynchronous so we need to poll to determine if uploads are completed diff --git a/Oqtane.Server/Controllers/UserController.cs b/Oqtane.Server/Controllers/UserController.cs index 68eda0876..a3521feda 100644 --- a/Oqtane.Server/Controllers/UserController.cs +++ b/Oqtane.Server/Controllers/UserController.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Security.Claims; using Oqtane.Shared; -using System; using System.Net; using Oqtane.Enums; using Oqtane.Infrastructure; @@ -386,6 +385,7 @@ public User Authenticate() } if (roles != "") roles = ";" + roles; user.Roles = roles; + user.SecurityStamp = User.SecurityStamp(); } return user; }