Beispiel #1
0
        public async Task <FirebaseAuthLink> LoginEmailPasswordAsync(string email, string password)
        {
            TokketUser user = new TokketUser()
            {
                Email = email, PasswordHash = password
            };

            client.BaseAddress = new Uri($"{userbaseUrl}/login{usercodePrefix}{userapiKey}");
            HttpResponseMessage response = await client.PostAsJsonAsync(client.BaseAddress, user);

            client = new HttpClient();

            return(JsonConvert.DeserializeObject <FirebaseAuthLink>(await response.Content.ReadAsStringAsync()));
        }
Beispiel #2
0
        public async Task <FirebaseAuthLink> SignUpAsync(string email, string password, string displayName, string country, DateTime date, string userPhoto)
        {
            TokketUser user = new TokketUser()
            {
                Email = email, PasswordHash = password, DisplayName = displayName, Country = country, Birthday = date, UserPhoto = userPhoto
            };

            user.BirthDate  = $"{CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(date.Month)} {date.Day}";
            user.BirthYear  = date.Year;
            user.BirthMonth = date.Month;
            user.BirthDay   = date.Day;

            client.BaseAddress = new Uri($"{userbaseUrl}/signup{usercodePrefix}{userapiKey}");
            HttpResponseMessage response = await client.PostAsJsonAsync(client.BaseAddress, user);

            client = new HttpClient();
            var res = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <FirebaseAuthLink>(res));
        }