add exception filter when user not connected default to needing authentication and apply anonymous to some actions add user in get requests add user relation in link, comment and vote signup and in are ok now!
11 lines
576 B
Plaintext
11 lines
576 B
Plaintext
@model HN.Application.LinkDto
|
|
|
|
<a asp-action="Show" asp-controller="Links" asp-route-id="@Model.Id">@Model.Url - created at @Model.CreatedAt.ToLocalTime() by @Model.CreatedByName (👍: @Model.UpVotes / 👎: @Model.DownVotes)</a>
|
|
|
|
@if(User.Identity.IsAuthenticated) {
|
|
<form asp-controller="Links" asp-action="Vote" asp-route-id="@Model.Id" asp-route-url="@Model.Url" method="post">
|
|
<input type="hidden" name="redirectTo" value="@Context.Request.Path" />
|
|
<input type="submit" name="type" value="up" />
|
|
<input type="submit" name="type" value="down" />
|
|
</form>
|
|
} |