Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
webinar65
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нурбек Созоев
webinar65
Commits
04706103
Commit
04706103
authored
Jun 27, 2019
by
Нурбек Созоев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил форму выхода (Logout)
parent
28aaeb02
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
AccountController.cs
webinar65/Controllers/AccountController.cs
+10
-0
_Layout.cshtml
webinar65/Views/Shared/_Layout.cshtml
+4
-0
No files found.
webinar65/Controllers/AccountController.cs
View file @
04706103
...
@@ -45,5 +45,15 @@ namespace webinar65.Controllers
...
@@ -45,5 +45,15 @@ namespace webinar65.Controllers
return
View
(
model
);
return
View
(
model
);
}
}
public
async
Task
<
IActionResult
>
Logout
()
{
if
(
_signInManager
.
IsSignedIn
(
User
))
{
await
_signInManager
.
SignOutAsync
();
}
return
RedirectToAction
(
"Login"
);
}
}
}
}
}
webinar65/Views/Shared/_Layout.cshtml
View file @
04706103
...
@@ -35,6 +35,10 @@
...
@@ -35,6 +35,10 @@
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"Index"
>
Home
</a></li>
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"Index"
>
Home
</a></li>
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"About"
>
About
</a></li>
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"About"
>
About
</a></li>
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"Contact"
>
Contact
</a></li>
<li><a
asp-area=
""
asp-controller=
"Home"
asp-action=
"Contact"
>
Contact
</a></li>
@if (User.Identity.IsAuthenticated)
{
<li><a
asp-area=
""
asp-controller=
"Account"
asp-action=
"Logout"
>
Log out
</a></li>
}
</ul>
</ul>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment