This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -35,7 +35,7 @@
|
|||||||
"SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;",
|
"SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;",
|
||||||
"SOCKEYE_DATA_PATH": "c:\\temp\\sockeye",
|
"SOCKEYE_DATA_PATH": "c:\\temp\\sockeye",
|
||||||
"SOCKEYE_USE_URLS": "http://*:7676;",
|
"SOCKEYE_USE_URLS": "http://*:7676;",
|
||||||
"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true",
|
//"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true",
|
||||||
//"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true",
|
//"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true",
|
||||||
//"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1",
|
//"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1",
|
||||||
"SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"
|
"SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ export default {
|
|||||||
//call erase
|
//call erase
|
||||||
window.$gz.erasingDatabase = true; //suspend notify polling
|
window.$gz.erasingDatabase = true; //suspend notify polling
|
||||||
await window.$gz.api.upsert(
|
await window.$gz.api.upsert(
|
||||||
API_BASE_URL + "/permanently-erase-all-data",
|
API_BASE_URL + "permanently-erase-all-data",
|
||||||
"I bloody understand"
|
"I bloody understand"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -602,11 +602,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//call erase
|
|
||||||
window.$gz.erasingDatabase = true; //suspend notify polling
|
window.$gz.erasingDatabase = true; //suspend notify polling
|
||||||
await window.$gz.api.upsert(API_BASE_URL + "/import-rockfish");
|
await window.$gz.api.upsert(API_BASE_URL + "import-rockfish");
|
||||||
|
|
||||||
vm.$router.push("/login");
|
//vm.$router.push("/login");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,19 +136,47 @@ namespace Sockeye.Biz
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//var content = new StringContent("login=john&password=b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c");
|
||||||
var content = new StringContent(JsonConvert.SerializeObject(new
|
var content = new StringContent(JsonConvert.SerializeObject(new
|
||||||
{
|
{
|
||||||
login = "john",
|
login = "john",
|
||||||
password = "b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c"
|
password = "b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c"
|
||||||
}), Encoding.UTF8, "application/json");
|
}), Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
// var content = new StringContent("login=john&password=b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c", Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
|
||||||
var client = ServiceProviderProvider.HttpClientFactory.CreateClient();
|
var client = ServiceProviderProvider.HttpClientFactory.CreateClient();
|
||||||
var res = await client.PostAsync($"{URL_ROCKFISH}/authenticate", content);
|
var res = await client.PostAsync($"{URL_ROCKFISH}authenticate?login=john&password=b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c", content);
|
||||||
var responseText = await res.Content.ReadAsStringAsync();
|
var responseText = await res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
if (res.IsSuccessStatusCode)
|
if (res.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
log.LogInformation(responseText);
|
log.LogInformation(responseText);
|
||||||
}
|
}
|
||||||
else log.LogError($"E1020 - Error authenticating to rockfish: {res.ReasonPhrase}");
|
else log.LogError($"E1020 - Error authenticating to rockfish: {res.ReasonPhrase}");
|
||||||
|
|
||||||
|
var responseJson = JObject.Parse(responseText);
|
||||||
|
|
||||||
|
var authToken = responseJson["token"].Value<string>();
|
||||||
|
var dlKey = responseJson["dlkey"].Value<string>();
|
||||||
|
var userId = responseJson["id"].Value<long>();
|
||||||
|
// var keyText = responseJson["data"]["key"].Value<string>();
|
||||||
|
|
||||||
|
// {{
|
||||||
|
// "ok": 1,
|
||||||
|
// "issued": 1672162767,
|
||||||
|
// "expires": 1674754767,
|
||||||
|
// "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNjcyMTYyNzY3IiwiZXhwIjoiMTY3NDc1NDc2NyIsImlzcyI6InJvY2tmaXNoQ29yZSIsImlkIjoiMiJ9.59Boie4EYtuRkccpf9QG8oszitx8UkGwAozgU1Effjk",
|
||||||
|
// "dlkey": "Cz48oUgPfEitcJ3/Dxw",
|
||||||
|
// "name": "John Cardinal",
|
||||||
|
// "id": 2
|
||||||
|
// }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user