1 files changed, 30 insertions, 5 deletions
diff --git a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
index 429e93c..cbff880 100644
--- a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
+++ b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
@@ -3,11 +3,6 @@
namespace SafeNSound.Sdk;
public class SafeNSoundAuthentication(SafeNSoundConfiguration config) {
- // public async Task<SafeNSoundAuthResult> Login(string username, string password)
- // {
-
- // }
-
public async Task<SafeNSoundAuthResult> Register(RegisterDto registerDto) {
var hc = new WrappedHttpClient() {
BaseAddress = new Uri(config.BaseUri)
@@ -16,6 +11,25 @@ public class SafeNSoundAuthentication(SafeNSoundConfiguration config) {
var res = await hc.PostAsJsonAsync("/auth/register", registerDto);
return null!;
}
+
+ public async Task<SafeNSoundAuthResult> Login(AuthDto authDto) {
+ var hc = new WrappedHttpClient() {
+ BaseAddress = new Uri(config.BaseUri)
+ };
+
+ var res = await hc.PostAsJsonAsync("/auth/login", authDto);
+ return null!;
+ }
+
+ public async Task<SafeNSoundAuthResult> Delete(AuthDto authDto) {
+ var hc = new WrappedHttpClient() {
+ BaseAddress = new Uri(config.BaseUri)
+ };
+
+ var res = await hc.DeleteAsJsonAsync("/auth/delete", authDto);
+ res.EnsureSuccessStatusCode();
+ return null!;
+ }
}
public class RegisterDto {
@@ -32,4 +46,15 @@ public class RegisterDto {
public string UserType { get; set; } = string.Empty;
}
+public class AuthDto {
+ [JsonPropertyName("username")]
+ public string Username { get; set; } = string.Empty;
+
+ [JsonPropertyName("password")]
+ public string Password { get; set; } = string.Empty;
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; } = string.Empty;
+}
+
public class SafeNSoundAuthResult { }
\ No newline at end of file
|