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.cs46
1 files changed, 31 insertions, 15 deletions
diff --git a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs

index 7d88ec8..429e93c 100644 --- a/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs +++ b/testFrontend/SafeNSound.Sdk/SafeNSoundAuthentication.cs
@@ -1,19 +1,35 @@ -namespace SafeNSound.Sdk; +using System.Text.Json.Serialization; -public class SafeNSoundAuthentication(SafeNSoundConfiguration config) -{ - public async Task<SafeNSoundAuthResult> Login(string username, string password) - { - - } - - public async Task<SafeNSoundAuthResult> Register(string username, string password) - { - +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) + }; + + var res = await hc.PostAsJsonAsync("/auth/register", registerDto); + return null!; } } -public class SafeNSoundAuthResult -{ - -} \ No newline at end of file +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; + + [JsonPropertyName("type")] + public string UserType { get; set; } = string.Empty; +} + +public class SafeNSoundAuthResult { } \ No newline at end of file