Files
social-media/src/Application/Common/Interfaces/IIdentityService.cs

22 lines
965 B
C#

using Google.Apis.Oauth2.v2.Data;
using Hutopy.Application.Common.Models;
namespace Hutopy.Application.Common.Interfaces;
public interface IIdentityService
{
Task<string?> GetUserNameAsync(string userId);
Task<Result> CreateUserAsync(string email, string userName, string firstName, string lastName, string password);
Task<UserModel?> FindUserByIdAsync(string id);
Task<UserModel?> GetCurrentUserAsync();
Task<UserModel?> FindUserByEmailAsync(string id);
Task<string?> LoginAsync(string email, string password);
Task<UserModel?> GetUserByUserNameAsync(string userName);
Task<bool> IsInRoleAsync(string userId, string role);
Task<bool> AuthorizeAsync(string userId, string policyName);
Task<Result> AddRoleAsync(string userId, string role);
Task<IList<string>> GetCurrentUserRolesAsync();
Task<(Result Result, string UserId)> CreateUserAsync(Userinfo userInfo);
Task<Result> DeleteUserAsync(string userId);
}