-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathIUserService.cs
89 lines (79 loc) · 3.66 KB
/
IUserService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using Generic.Models;
using Microsoft.AspNetCore.Identity;
using MVCCaching;
using System.Threading.Tasks;
namespace Generic.Services.Interfaces
{
public interface IUserService : IService
{
/// <summary>
/// Creates a user on the website.
/// </summary>
/// <param name="User">The User information</param>
/// <param name="Password">The Password</param>
/// <param name="Enabled">If they should be enabled right away</param>
/// <returns>The UserInfo Object</returns>
Task<User> CreateUserAsync(User user, string Password, bool Enabled = false);
/// <summary>
/// Sends a Registration Confirmation Email Asyncly to the given User, with the Confirmation link provided
/// </summary>
/// <param name="user">The User object</param>
/// <param name="ConfirmationLink">The base URL for the Email Confirmation string, the user GUID and Hash are appended to this</param>
/// <returns></returns>
Task SendRegistrationConfirmationEmailAsync(User user, string ConfirmationLink);
/// <summary>
/// Validates the Token request for the given User
/// </summary>
/// <param name="UserID">The User's ID</param>
/// <param name="token">The Token</param>
/// <returns>If the token is valid</returns>
Task<IdentityResult> ConfirmRegistrationConfirmationTokenAsync(User user, string token);
/// <summary>
/// Sends a password reset email for the given user
/// </summary>
/// <param name="user">The User object</param>
/// <param name="ConfirmationLink">The base URL for the Email Confirmation string, the user GUID and Hash are appended to this</param>
/// <returns></returns>
Task SendPasswordResetEmailAsync(User user, string ConfirmationLink);
/// <summary>
/// Validates and resets the password for the given user and token
/// </summary>
/// <param name="UserID">The User's ID</param>
/// <param name="Token">The Token</param>
/// <param name="NewPassword">The new password</param>
/// <returns>If the operation was successful</returns>
Task<IdentityResult> ResetPasswordFromTokenAsync(User user, string Token, string NewPassword);
/// <summary>
/// Validates if the password is valid for the given user
/// </summary>
/// <param name="user">The user</param>
/// <param name="password">the password</param>
/// <returns>If it's the correct password</returns>
Task<bool> ValidateUserPasswordAsync(User user, string password);
/// <summary>
/// Resets the password of the given user
/// </summary>
/// <param name="userName">The Username</param>
/// <param name="password">The password to reset it to</param>
Task ResetPasswordAsync(User user, string password);
/// <summary>
/// Validates that the given password passes the site's Password Policy
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
Task<bool> ValidatePasswordPolicyAsync(string password);
/// <summary>
/// Creates an external user
/// </summary>
/// <param name="user">The user</param>
/// <returns></returns>
Task CreateExternalUserAsync(User user);
/// <summary>
/// Sends the verification token to the given user.
/// </summary>
/// <param name="actualUser"></param>
/// <param name="token"></param>
/// <returns></returns>
Task SendVerificationCodeEmailAsync(User actualUser, string token);
}
}