mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 15:53:44 +00:00
Added register page and accounts repo. Switch to color instead of bg image.
This commit is contained in:
30
src/App/Repositories/AccountsApiRepository.cs
Normal file
30
src/App/Repositories/AccountsApiRepository.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Repositories
|
||||
{
|
||||
public class AccountsApiRepository : BaseApiRepository, IAccountsApiRepository
|
||||
{
|
||||
protected override string ApiRoute => "accounts";
|
||||
|
||||
public virtual async Task<ApiResult> PostRegisterAsync(RegisterRequest requestObj)
|
||||
{
|
||||
var requestMessage = new TokenHttpRequestMessage(requestObj)
|
||||
{
|
||||
Method = HttpMethod.Post,
|
||||
RequestUri = new Uri(Client.BaseAddress, string.Concat(ApiRoute, "/register")),
|
||||
};
|
||||
|
||||
var response = await Client.SendAsync(requestMessage);
|
||||
if(!response.IsSuccessStatusCode)
|
||||
{
|
||||
return await HandleErrorAsync(response);
|
||||
}
|
||||
|
||||
return ApiResult.Success(response.StatusCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user