Merge pull request 'working' (#14) from working into main
Docker Build and Release Upload / build (push) Successful in 1m21s
Docker Build and Release Upload / build (push) Successful in 1m21s
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
@@ -31,7 +31,7 @@ export class Authentication{
|
||||
}
|
||||
|
||||
get isLoggedIn(): boolean {
|
||||
return this._user.value.id != -1 ? true : false;
|
||||
return this._user.value.id == null ? true : false;
|
||||
}
|
||||
|
||||
get loggedInUser(): Account {
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace BoredCareers.Controllers {
|
||||
signOut();
|
||||
return Redirect("/");
|
||||
}
|
||||
return NotFound();
|
||||
return NotFound("Not logged in");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,18 +89,18 @@ 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();
|
||||
using (RSA rsa = RSA.Create()) {
|
||||
rsa.ImportFromPem(publicKey);
|
||||
PublicKey = new RsaSecurityKey(rsa);
|
||||
}
|
||||
}
|
||||
|
||||
if (PublicKey == null) {
|
||||
Console.WriteLine("Unable to load RSA PubKey Shutting Down");
|
||||
Environment.Exit(100);
|
||||
} else {
|
||||
await Task.Delay(2000); // sleep the main thread for 2 seconds before sending another request. Prevent DDOS of my own equiptment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
builder.Services.AddAuthentication(options => {
|
||||
|
||||
Reference in New Issue
Block a user