on .NET MAUI provide message to user if Security Token has not been configured
This commit is contained in:
parent
64c7f1962c
commit
ac313722f9
|
@ -359,12 +359,6 @@
|
||||||
}
|
}
|
||||||
if (restricted == "")
|
if (restricted == "")
|
||||||
{
|
{
|
||||||
if (!ShowProgress)
|
|
||||||
{
|
|
||||||
_uploading = true;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// upload the files
|
// upload the files
|
||||||
|
@ -374,7 +368,21 @@
|
||||||
if (PageState.Runtime == Shared.Runtime.Hybrid)
|
if (PageState.Runtime == Shared.Runtime.Hybrid)
|
||||||
{
|
{
|
||||||
jwt = await UserService.GetTokenAsync();
|
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);
|
await interop.UploadFiles(posturl, folder, _guid, SiteState.AntiForgeryToken, jwt);
|
||||||
|
|
||||||
// uploading is asynchronous so we need to poll to determine if uploads are completed
|
// uploading is asynchronous so we need to poll to determine if uploads are completed
|
||||||
|
|
|
@ -6,7 +6,6 @@ using System.Threading.Tasks;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using System;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
|
@ -386,6 +385,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
if (roles != "") roles = ";" + roles;
|
if (roles != "") roles = ";" + roles;
|
||||||
user.Roles = roles;
|
user.Roles = roles;
|
||||||
|
user.SecurityStamp = User.SecurityStamp();
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user