Migration to EF and starting to add Identity #11
12
Newsbot.Collector.Api/Domain/Requests/RegisterUserRequest.cs
Normal file
12
Newsbot.Collector.Api/Domain/Requests/RegisterUserRequest.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Newsbot.Collector.Api.Domain.Requests;
|
||||||
|
|
||||||
|
public class RegisterUserRequest
|
||||||
|
{
|
||||||
|
//public string? Name { get; set; }
|
||||||
|
[EmailAddress]
|
||||||
|
public string? Email { get; set; }
|
||||||
|
public string? Password { get; set; }
|
||||||
|
|
||||||
|
}
|
10
Newsbot.Collector.Api/Domain/Requests/UserLoginRequest.cs
Normal file
10
Newsbot.Collector.Api/Domain/Requests/UserLoginRequest.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Newsbot.Collector.Api.Domain.Requests;
|
||||||
|
|
||||||
|
public class UserLoginRequest
|
||||||
|
{
|
||||||
|
[EmailAddress]
|
||||||
|
public string? Email { get; set; }
|
||||||
|
public string? Password { get; set; }
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
namespace Newsbot.Collector.Api.Domain.Response;
|
||||||
|
|
||||||
|
public class AuthFailedResponse
|
||||||
|
{
|
||||||
|
public IEnumerable<string>? Errors { get; set; }
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
namespace Newsbot.Collector.Api.Domain.Response;
|
||||||
|
|
||||||
|
public class AuthSuccessfulResponse
|
||||||
|
{
|
||||||
|
// might want to validate the user before we return the token
|
||||||
|
|
||||||
|
public string? Token { get; set; }
|
||||||
|
}
|
11
Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs
Normal file
11
Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace Newsbot.Collector.Api.Domain.Results;
|
||||||
|
|
||||||
|
public class AuthenticationResult
|
||||||
|
{
|
||||||
|
public string? Token { get; set; }
|
||||||
|
|
||||||
|
public bool IsSuccessful { get; set; }
|
||||||
|
public IEnumerable<string>? ErrorMessage { get; set; }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user