Skip to content

Commit

Permalink
Merge pull request #202 from eatskolnikov/development
Browse files Browse the repository at this point in the history
Added Isauthenticated flag to user profile
  • Loading branch information
eatskolnikov committed Jul 25, 2020
2 parents f2643ba + ca9c8bd commit 2a2f9fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Web/Controllers/JobsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public async Task<IActionResult> Details(string Id, bool isPreview = false, bool
var viewModel = new JobDetailsViewModel
{
Job = job,
IsJobOwner = (job.UserId == _currentUser.UserId)
IsJobOwner = _currentUser.IsAuthenticated && job.UserId == _currentUser.UserId
};

if (!isLegacy)
Expand Down
2 changes: 2 additions & 0 deletions Web/Framework/ApplicationUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public ApplicationUser(ClaimsPrincipal user)
{
_user = user;
}

public bool IsAuthenticated { get { return _user.Identity.IsAuthenticated; } }
public int UserId { get { return Convert.ToInt32(_user.FindFirst("UserId").Value); } }
public string SocialId { get { return _user.FindFirst(ClaimTypes.NameIdentifier).Value; } }
public string Email { get { return _user.FindFirst(ClaimTypes.Email).Value; } }
Expand Down

0 comments on commit 2a2f9fc

Please sign in to comment.