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);
|
||||
|
||||
@@ -86,23 +86,23 @@ namespace raven_integration
|
||||
|
||||
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)
|
||||
password = login;
|
||||
// if (!authDict.ContainsKey(login))
|
||||
// {
|
||||
// dynamic creds = new JObject();
|
||||
// creds.login = login;
|
||||
// creds.password = password;
|
||||
|
||||
if (!authDict.ContainsKey(login))
|
||||
{
|
||||
dynamic creds = new JObject();
|
||||
creds.login = login;
|
||||
creds.password = password;
|
||||
// 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
|
||||
// ValidateDataReturnResponseOk(a);
|
||||
|
||||
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
|
||||
ValidateDataReturnResponseOk(a);
|
||||
|
||||
authDict[login] = a.ObjectResponse["data"]["token"].Value<string>();
|
||||
}
|
||||
return authDict[login];
|
||||
// authDict[login] = a.ObjectResponse["data"]["token"].Value<string>();
|
||||
// }
|
||||
// return authDict[login];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user