summary refs log tree commit diff
path: root/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
diff options
context:
space:
mode:
Diffstat (limited to 'testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs')
-rw-r--r--testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs17
1 files changed, 4 insertions, 13 deletions
diff --git a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs

index 333db6d..d0ed245 100644 --- a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs +++ b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
@@ -13,13 +13,13 @@ public class SafeNSoundAuthentication(SafeNSoundConfiguration config) { res.EnsureSuccessStatusCode(); } - public async Task<SafeNSoundAuthResult> Login(AuthDto authDto) { + public async Task<AuthResult> Login(AuthDto authDto) { var hc = new WrappedHttpClient() { BaseAddress = new Uri(config.BaseUri) }; var res = await hc.PostAsJsonAsync("/auth/login", authDto); - return (await res.Content.ReadFromJsonAsync<SafeNSoundAuthResult>())!; + return (await res.Content.ReadFromJsonAsync<AuthResult>())!; } public async Task Delete(AuthDto authDto) { @@ -32,16 +32,7 @@ public class SafeNSoundAuthentication(SafeNSoundConfiguration config) { } } -public class RegisterDto { - [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 RegisterDto : AuthDto { [JsonPropertyName("type")] public string UserType { get; set; } = string.Empty; } @@ -68,7 +59,7 @@ public class WhoAmI { public required string UserType { get; set; } } -public class SafeNSoundAuthResult : WhoAmI { +public class AuthResult : WhoAmI { [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } } \ No newline at end of file