Merge branch 'release/1.0.0' of github.com:ONLYOFFICE/AppServer into release/1.0.0

This commit is contained in:
Tatiana Lopaeva 2021-09-08 10:39:42 +03:00
commit a0841a3eef
6 changed files with 14 additions and 4 deletions

View File

@ -4,6 +4,7 @@ using System.Text.Encodings.Web;
using System.Threading.Tasks;
using ASC.Core;
using ASC.Web.Core;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Logging;
@ -13,23 +14,32 @@ namespace ASC.Api.Core.Auth
{
public class CookieAuthHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{
private SecurityContext SecurityContext { get; }
private CookiesManager CookiesManager { get; }
public CookieAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
{
}
//
public CookieAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, SecurityContext securityContext)
public CookieAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, SecurityContext securityContext, CookiesManager cookiesManager)
: this(options, logger, encoder, clock)
{
SecurityContext = securityContext;
CookiesManager = cookiesManager;
}
private SecurityContext SecurityContext { get; }
protected override Task<AuthenticateResult> HandleAuthenticateAsync()
{
var token = Context.Request.Cookies["asc_auth_key"] ?? Context.Request.Headers["Authorization"];
var result = SecurityContext.AuthenticateMe(token);
if (!result)
{
SecurityContext.Logout();
CookiesManager.ClearCookies(CookiesType.AuthKey);
CookiesManager.ClearCookies(CookiesType.SocketIO);
}
return Task.FromResult(
result ?
AuthenticateResult.Success(new AuthenticationTicket(Context.User, new AuthenticationProperties(), Scheme.Name)) :

View File

@ -49,7 +49,7 @@ class ArticleMainButtonContent extends React.Component {
onFileChange = (e) => {
const { startUpload, t } = this.props;
this.goToHomePage();
//this.goToHomePage();
startUpload(e.target.files, null, t);
};

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB