Academatica.Api/Academatica.Api.Auth/Controllers/ConnectController.cs
/// <summary>
/// User email post-registration confirmation endpoint.
/// </summary>
/// <param name="userId">User ID.</param>
/// <param name="code">Confirmation code (generated automatically).</param>
User email post-registration confirmation endpoint.
User email post - registration confirmation endpoint .
[HttpGet]
        [Route("confirm-mail")]
        public async Task<IActionResult> ConfirmEmail(string userId, string code)
        {
            var website = _configuration["Website"];
            if (userId == null || code == null)
            {
                return Redirect(website + "/email-not-confirmed");
            }
            var user = await _userManager.FindByIdAsync(userId);
            if (user == null)
            {
                return Redirect(website + "/email-not-confirmed");
            }
            var result = await _userManager.ConfirmEmailAsync(user, code);
            if (result.Succeeded)
            {
                return Redirect(website + "/email-confirmed");
            }
            return Redirect(website + "/email-not-confirmed");
        }
[ HttpGet ] [ Route ( " " ) ] public async Task < IActionResult > ConfirmEmail ( string userId , string code ) { var website = _configuration [ " " ] ; if ( userId == null || code == null ) { return Redirect ( website + " " ) ; } var user = await _userManager . FindByIdAsync ( userId ) ; if ( user == null ) { return Redirect ( website + " " ) ; } var result = await _userManager . ConfirmEmailAsync ( user , code ) ; if ( result . Succeeded ) { return Redirect ( website + " " ) ; } return Redirect ( website + " " ) ; }
User email post-registration confirmation endpoint.
User email post - registration confirmation endpoint .
userId
string
None
code
string
Confirmation code (generated automatically).
Confirmation code ( generated automatically ) .