diff options
author | David Christiansen <coding@davedoes.net> | 2015-01-05 21:29:48 +0000 |
---|---|---|
committer | David Christiansen <coding@davedoes.net> | 2015-01-05 21:29:48 +0000 |
commit | 5fde84cfe2967d203c8bc183708394d95bb52c36 (patch) | |
tree | b082a01743f2d20ce80dddcc4a99f88f0c49e1c4 /samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml | |
parent | f840b593c345265ebcfd6c1cf5b57ab6d948f92c (diff) | |
download | DotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.zip DotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.tar.gz DotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.tar.bz2 |
Straight forward OpenID Connect RP example
Diffstat (limited to 'samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml')
-rw-r--r-- | samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml new file mode 100644 index 0000000..f996508 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml @@ -0,0 +1,22 @@ +@using Microsoft.AspNet.Identity +@if (Request.IsAuthenticated) +{ + using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) + { + @Html.AntiForgeryToken() + + <ul class="nav navbar-nav navbar-right"> + <li> + @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" }) + </li> + <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li> + </ul> + } +} +else +{ + <ul class="nav navbar-nav navbar-right"> + <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li> + <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li> + </ul> +} |