CodeLiturgy.Dashboard/BlueWest.Api/Users/Auth/IAuthManager.cs

43 lines
1.2 KiB
C#
Raw Normal View History

2022-09-17 22:13:35 +03:00
using System;
using System.Security.Claims;
2022-09-10 00:33:17 +03:00
using System.Threading.Tasks;
2022-09-17 22:13:35 +03:00
using BlueWest.Data.Application;
2022-09-10 00:33:17 +03:00
using Microsoft.AspNetCore.Identity;
namespace BlueWest.WebApi.Context.Users;
2022-09-10 07:12:03 +03:00
/// <summary>
/// Auth manager contract interface.
/// </summary>
2022-09-10 00:33:17 +03:00
public interface IAuthManager
{
2022-09-10 07:12:03 +03:00
/// <summary>
/// CreateUserAsync
/// </summary>
/// <param name="registerViewModel"></param>
/// <returns></returns>
2022-09-10 00:33:17 +03:00
Task<IdentityResult> CreateUserAsync(RegisterViewModel registerViewModel);
2022-09-10 07:12:03 +03:00
/// <summary>
/// VerifyLoginAsync
/// </summary>
/// <param name="email"></param>
/// <param name="password"></param>
/// <returns></returns>
2022-09-17 22:13:35 +03:00
Task<bool> VerifyLoginByEmailAsync(string email, string password);
2022-09-10 00:33:17 +03:00
2022-09-10 07:12:03 +03:00
/// <summary>
/// GetToken
/// </summary>
2022-09-17 22:13:35 +03:00
/// <param name="loginRequest"></param>
2022-09-10 07:12:03 +03:00
/// <returns></returns>
2022-09-17 22:13:35 +03:00
Task<(bool, SessionTokenUnique, AccessToken)> GetToken(LoginRequest loginRequest);
/// <summary>
/// Does Login
/// </summary>
/// <param name="loginRequest"></param>
/// <returns></returns>
Task<(bool, ClaimsIdentity, SessionTokenUnique)> DoLogin(LoginRequest loginRequest);
2022-09-10 00:33:17 +03:00
}