main
吴顺明 1 year ago
parent c89f7cd62e
commit 92237ce314

@ -384,18 +384,11 @@ namespace UMC.Proxy
var transfer = context.QueryString.Get("transfer");
if (context.Token.IsAuthenticated)
{
if (String.IsNullOrEmpty(transfer) == false)
if (String.IsNullOrEmpty(transfer) == false && String.Equals(GetCookie(context), transfer) == false)
{
if (String.Equals(GetCookie(context), transfer) == false)
{
var sesion = UMC.Data.DataFactory.Instance().Session(context.Token.Device.ToString());
if (sesion != null)
{
sesion.SessionKey = transfer;
UMC.Data.DataFactory.Instance().Put(sesion);
}
}
var login = UMC.Data.Reflection.Configuration("account")?["login"];
var timeout = UMC.Data.Utility.IntParse(login?.Attributes?["timeout"], 3600);
new UMC.Data.AccessToken(Utility.Guid(transfer, true).Value).Login(context.Token.Identity(), timeout).Commit("Desktop", context.UserHostAddress, context.Server);
}
context.Redirect(oauth_callback);
return;
@ -684,11 +677,7 @@ namespace UMC.Proxy
var secret = p.Provider["appSecret"];
var appId = p.Provider["appId"];
var type = typeof(UMC.Data.Entities.Session).FullName;
// var nvs = new NameValueCollection();
// var time = UMC.Data.Utility.TimeSpan().ToString();
// nvs.Add("from", appId);
// nvs.Add("time", time);
// nvs.Add("type", type);
var webD = new Web.WebMeta();
webD.Put("from", appId);
@ -1291,11 +1280,10 @@ namespace UMC.Proxy
var Value = UMC.Data.JSON.Deserialize<UMC.Data.AccessToken>(seesion.Content);
if (Value != null)
{
var user = Value.Identity();
var login = (UMC.Data.Reflection.Configuration("account") ?? new ProviderConfiguration())["login"] ?? Provider.Create("name", "name");
var timeout = UMC.Data.Utility.IntParse(login.Attributes["timeout"], 3600);
context.Token = new UMC.Data.AccessToken(sessionKey).Login(user, timeout);
context.Token.Commit("Desktop", context.UserHostAddress, context.Server);
var login = UMC.Data.Reflection.Configuration("account")?["login"];
var timeout = UMC.Data.Utility.IntParse(login?.Attributes?["timeout"], 3600);
new UMC.Data.AccessToken(sessionKey).Login(Value.Identity(), timeout).Commit("Desktop", context.UserHostAddress, context.Server);
}
UMC.Data.DataFactory.Instance().Delete(seesion);
}

Loading…
Cancel
Save