19 lines
No EOL
442 B
C#
19 lines
No EOL
442 B
C#
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using Website.Models;
|
|
|
|
namespace Website.Data {
|
|
public class AuthenticationProvider:ApiClient, IAuthenticationProvider {
|
|
public AuthenticationProvider(HttpClient client) : base(client) {
|
|
}
|
|
|
|
public async Task<User> Authenticate(LoginRequest request) {
|
|
try {
|
|
return await Post<User>("authenticate", request);
|
|
}
|
|
catch (ApiCallException) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |