From ead0edec370483e5e80d42cc49c67f13e28c13b1 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 8 May 2021 18:46:46 +0300 Subject: Implemented account deletion --- ExamTemplate/Services/UserService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ExamTemplate/Services') diff --git a/ExamTemplate/Services/UserService.cs b/ExamTemplate/Services/UserService.cs index 2f137a1..8e5c682 100644 --- a/ExamTemplate/Services/UserService.cs +++ b/ExamTemplate/Services/UserService.cs @@ -77,6 +77,14 @@ namespace ExamTemplate.Services return result.Succeeded; } + public async Task DeleteUserAsync(ClaimsPrincipal claimsPrincipal) + { + User user = await this._userManager.GetUserAsync(claimsPrincipal); + + IdentityResult result = await this._userManager.DeleteAsync(user); + return result.Succeeded; + } + public bool IsSignedIn(ClaimsPrincipal claimsPrincipal) { return this._signInManager.IsSignedIn(claimsPrincipal); -- cgit v1.2.3