Skip to content

Commit 2a2f9fc

Browse files
authored
Merge pull request #202 from eatskolnikov/development
Added Isauthenticated flag to user profile
2 parents f2643ba + ca9c8bd commit 2a2f9fc

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Web/Controllers/JobsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public async Task<IActionResult> Details(string Id, bool isPreview = false, bool
291291
var viewModel = new JobDetailsViewModel
292292
{
293293
Job = job,
294-
IsJobOwner = (job.UserId == _currentUser.UserId)
294+
IsJobOwner = _currentUser.IsAuthenticated && job.UserId == _currentUser.UserId
295295
};
296296

297297
if (!isLegacy)

Web/Framework/ApplicationUser.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public ApplicationUser(ClaimsPrincipal user)
1515
{
1616
_user = user;
1717
}
18+
19+
public bool IsAuthenticated { get { return _user.Identity.IsAuthenticated; } }
1820
public int UserId { get { return Convert.ToInt32(_user.FindFirst("UserId").Value); } }
1921
public string SocialId { get { return _user.FindFirst(ClaimTypes.NameIdentifier).Value; } }
2022
public string Email { get { return _user.FindFirst(ClaimTypes.Email).Value; } }

0 commit comments

Comments
 (0)