Add logout link in sidebar
This commit is contained in:
parent
955ee0f126
commit
22061e3f4a
2 changed files with 13 additions and 6 deletions
|
@ -37,6 +37,14 @@ fun Application.userWebRoutes(userService: UserService) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
route("/logout") {
|
||||||
|
post {
|
||||||
|
call.sessions.clear<CookieSession>()
|
||||||
|
call.respondRedirect("/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
route("/register") {
|
route("/register") {
|
||||||
get {
|
get {
|
||||||
call.respond(MustacheContent("register.mustache", RegisterPage()))
|
call.respond(MustacheContent("register.mustache", RegisterPage()))
|
||||||
|
|
|
@ -40,13 +40,12 @@
|
||||||
About Twigs
|
About Twigs
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
TODO: Implement logout
|
|
||||||
<li class="list-item">
|
|
||||||
<a href="/logout">
|
|
||||||
Logout
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
-->
|
-->
|
||||||
|
<li class="list-item">
|
||||||
|
<form action="/logout" method="post">
|
||||||
|
<input type="submit" value="Logout"/>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
<li class="list-item">
|
<li class="list-item">
|
||||||
<a href="https://github.com/wbrawner/twigs">
|
<a href="https://github.com/wbrawner/twigs">
|
||||||
Source Code
|
Source Code
|
||||||
|
|
Loading…
Reference in a new issue