This commit is contained in:
30
util.cs
30
util.cs
@@ -53,7 +53,7 @@ namespace raven_integration
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
|
// public static ConcurrentDictionary<string, string> authDict = new ConcurrentDictionary<string, string>();//10,32
|
||||||
|
|
||||||
private static AutoId Auto { get; } = new AutoId(0);
|
private static AutoId Auto { get; } = new AutoId(0);
|
||||||
|
|
||||||
@@ -86,23 +86,23 @@ namespace raven_integration
|
|||||||
|
|
||||||
public async static Task<string> GetTokenAsync(string login, string password = null)
|
public async static Task<string> GetTokenAsync(string login, string password = null)
|
||||||
{
|
{
|
||||||
|
return await CredRepo.GetTokenAsync(login,password);
|
||||||
|
// if (password == null)
|
||||||
|
// password = login;
|
||||||
|
|
||||||
if (password == null)
|
// if (!authDict.ContainsKey(login))
|
||||||
password = login;
|
// {
|
||||||
|
// dynamic creds = new JObject();
|
||||||
|
// creds.login = login;
|
||||||
|
// creds.password = password;
|
||||||
|
|
||||||
if (!authDict.ContainsKey(login))
|
// ApiResponse a = await Util.PostAsync("Auth", null, creds.ToString());
|
||||||
{
|
// //Put this in when having concurrency issue during auth and old style dl token creation during login
|
||||||
dynamic creds = new JObject();
|
// ValidateDataReturnResponseOk(a);
|
||||||
creds.login = login;
|
|
||||||
creds.password = password;
|
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("Auth", null, creds.ToString());
|
// authDict[login] = a.ObjectResponse["data"]["token"].Value<string>();
|
||||||
//Put this in when having concurrency issue during auth and old style dl token creation during login
|
// }
|
||||||
ValidateDataReturnResponseOk(a);
|
// return authDict[login];
|
||||||
|
|
||||||
authDict[login] = a.ObjectResponse["data"]["token"].Value<string>();
|
|
||||||
}
|
|
||||||
return authDict[login];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user