Beispiel #1
0
        public IActionResult JobGiverSignUp(JobGiverLoginSignUpViewModel model)
        {
            var response = _authApiService.JobGiverSignUp(model.JobGiverSignUpModel);

            if (!response.Success)
            {
                HttpContext.Session.SetString("Alert", AlertifyHelper.ErrorMessage(response.Message));
                return(RedirectToAction("JobGiverLoginSignUp"));
            }
            var identity = new ClaimsIdentity(new[] {
                new Claim(ClaimTypes.Name, model.JobGiverSignUpModel.Email),
                new Claim(ClaimTypes.Role, OperationClaimNames.Is_Veren)
            }, 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));
            return(RedirectToAction("Index", "Home", new { area = "JobGiver" }));
        }
Beispiel #2
0
        public IActionResult JobGiverLoginSignUp()
        {
            JobGiverLoginSignUpViewModel model = new JobGiverLoginSignUpViewModel();

            return(View(model));
        }