Merge pull request 'main' (#33) from main into working

Reviewed-on: #33
This commit was merged in pull request #33.
This commit is contained in:
2025-08-23 04:33:36 +00:00
3 changed files with 17 additions and 11 deletions
@@ -1,6 +1,6 @@
.center-frame {
margin: 0 200px;
width: calc(100% - 400px);
margin: 0 auto;
max-width: 1400px;
}
.center-text {
@@ -46,13 +46,12 @@ h1 {
}
.resume-section {
break-inside: avoid;
background-color: #DDDDDD;
margin-bottom: 10px;
}
.resume-sub-section {
border: 1px solid #666666;
break-inside: avoid;
padding: 10px;
}
+14 -7
View File
@@ -91,16 +91,23 @@ if (IPayment._PaymentType == PaymentType.StripeIntent) {
RsaSecurityKey? PublicKey = null;
using (HttpClient client = new HttpClient()) {
while (PublicKey == null) {
HttpResponseMessage PublicKeyResponse = await client.GetAsync("https://auth.mistox.com/api/auth/publickey");
if (PublicKeyResponse.IsSuccessStatusCode) {
string publicKey = await PublicKeyResponse.Content.ReadAsStringAsync();
RSA rsa = RSA.Create();
rsa.ImportFromPem(publicKey);
PublicKey = new RsaSecurityKey(rsa);
} else {
try {
HttpResponseMessage PublicKeyResponse = await client.GetAsync("https://auth.mistox.com/api/auth/publickey");
if (PublicKeyResponse.IsSuccessStatusCode) {
string publicKey = await PublicKeyResponse.Content.ReadAsStringAsync();
RSA rsa = RSA.Create();
rsa.ImportFromPem(publicKey);
PublicKey = new RsaSecurityKey(rsa);
} else {
await Task.Delay(2000); // sleep the main thread for 2 seconds before sending another request. Prevent DDOS of my own equiptment
Console.WriteLine("auth.mistox.com returned error code: " + PublicKeyResponse.StatusCode);
}
} catch (Exception e) {
await Task.Delay(2000); // sleep the main thread for 2 seconds before sending another request. Prevent DDOS of my own equiptment
Console.WriteLine("Error loading public key: " + e.InnerException?.Message);
}
}
Console.WriteLine("PublicKey loaded");
}
builder.Services.AddAuthentication(options => {