Merge pull request #2197 from sbwalker/dev
resolve login issue related to 'LoginOptions:TwoFactor' and order list of files alphabetically
This commit is contained in:
commit
21ff4a83b5
|
@ -206,7 +206,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
if (PageState.Site.Settings["LoginOptions:TwoFactor"] == "required" || user.TwoFactorRequired)
|
||||
if ((PageState.Site.Settings.ContainsKey("LoginOptions:TwoFactor") && PageState.Site.Settings["LoginOptions:TwoFactor"] == "required") || user.TwoFactorRequired)
|
||||
{
|
||||
twofactor = true;
|
||||
validated = false;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
|
@ -32,7 +33,8 @@ namespace Oqtane.Services
|
|||
|
||||
public async Task<List<File>> GetFilesAsync(string folder)
|
||||
{
|
||||
return await GetJsonAsync<List<File>>($"{Apiurl}?folder={folder}");
|
||||
List<File> files = await GetJsonAsync<List<File>>($"{Apiurl}?folder={folder}");
|
||||
return files.OrderBy(item => item.Name).ToList();
|
||||
}
|
||||
|
||||
public async Task<List<File>> GetFilesAsync(int siteId, string folderPath)
|
||||
|
@ -44,7 +46,8 @@ namespace Oqtane.Services
|
|||
|
||||
var path = WebUtility.UrlEncode(folderPath);
|
||||
|
||||
return await GetJsonAsync<List<File>>($"{Apiurl}/{siteId}/{path}");
|
||||
List<File> files = await GetJsonAsync<List<File>>($"{Apiurl}/{siteId}/{path}");
|
||||
return files.OrderBy(item => item.Name).ToList();
|
||||
}
|
||||
|
||||
public async Task<File> GetFileAsync(int fileId)
|
||||
|
|
Loading…
Reference in New Issue
Block a user