add writing exception in console

This commit is contained in:
Дмитрий Шиманский
2024-01-11 13:41:26 +03:00
parent e2800cfc2e
commit f1f635a520

View File

@@ -69,13 +69,19 @@
{
Response.Cookies.Append("melon", body["access_token"].ToString());
Response.Cookies.Append("watermelon", body["refresh_token"].ToString());
HttpContent bodytoApi = new StringContent(JsonConvert.SerializeObject(new yaflay.ru.Controllers.HomeController.authorizeBody()
try{
HttpContent bodytoApi = new StringContent(JsonConvert.SerializeObject(new yaflay.ru.Controllers.HomeController.authorizeBody()
{
discordId = body["user"]["id"].ToString(),
melon = body["access_token"].ToString(),
type = Auth.ApiKeyTypes.Public,
watermelon = body["watermelon"].ToString()
}));
}catch(Exception ex)
{
Console.WriteLine(body);
Console.WriteLine(ex.Message);
}
var req = await Startup.client.PostAsync(path + "/api/authorize", bodytoApi);
Response.Redirect("/authorize");
}