DD.WellWorkover.Cloud/AsbCloudApp/Services/IAuthService.cs

54 lines
1.6 KiB
C#
Raw Normal View History

using AsbCloudApp.Data.User;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Services;
/// <summary>
/// Сервис авторизации
/// </summary>
public interface IAuthService
{
2022-08-05 17:16:11 +05:00
/// <summary>
2024-08-19 10:01:07 +05:00
/// Смена пароля пользователю
2022-08-05 17:16:11 +05:00
/// </summary>
2024-08-19 10:01:07 +05:00
/// <param name="idUser"></param>
/// <param name="newPassword"></param>
/// <returns></returns>
void ChangePassword(int idUser, string newPassword);
2022-08-05 17:16:11 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Смена пароля пользователю
/// </summary>
/// <param name="userLogin"></param>
/// <param name="newPassword"></param>
/// <returns></returns>
void ChangePassword(string userLogin, string newPassword);
2022-08-05 17:16:11 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Авторизация
/// </summary>
/// <param name="login"></param>
/// <param name="password"></param>
/// <param name="token">токен отмены задачи</param>
/// <returns></returns>
Task<UserTokenDto?> LoginAsync(string login,
string password, CancellationToken token = default);
2024-08-19 10:01:07 +05:00
/// <summary>
/// Обновление токена авторизации
/// </summary>
/// <param name="identity"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<UserTokenDto?> RefreshAsync(ClaimsPrincipal identity,
CancellationToken token);
2022-08-05 17:16:11 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Регистрация нового пользователя
/// </summary>
/// <param name="userDto"></param>
/// <returns></returns>
void Register(UserRegistrationDto userDto);
}