public IActionResult JobSeekerSignUp(JobSeekerLoginSignUpViewModel model) { var response = _authApiService.JobSeekerSignUp(model.JobSeekerSignUpModel); if (!response.Success) { HttpContext.Session.SetString("Alert", AlertifyHelper.ErrorMessage(response.Message)); return(RedirectToAction("JobSeekerLoginSignUp")); } var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, model.JobSeekerSignUpModel.Email), new Claim(ClaimTypes.Role, OperationClaimNames.Is_Arayan) }, CookieAuthenticationDefaults.AuthenticationScheme); var principal = new ClaimsPrincipal(identity); var login = HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, principal); _tokenSessionHelper.SetToken(response.Data); HttpContext.Session.SetString("Alert", AlertifyHelper.SuccessMessage(Messages.SuccessRegister)); //todo: Alertify return(RedirectToAction("Index", "Home", new { area = "JobSeeker" })); }
public IActionResult JobSeekerLoginSignUp() { JobSeekerLoginSignUpViewModel model = new JobSeekerLoginSignUpViewModel(); return(View(model)); }