diff --git a/web/src/main/kotlin/com/wbrawner/twigs/web/user/UserWebRoutes.kt b/web/src/main/kotlin/com/wbrawner/twigs/web/user/UserWebRoutes.kt index d29f48c..7e79892 100644 --- a/web/src/main/kotlin/com/wbrawner/twigs/web/user/UserWebRoutes.kt +++ b/web/src/main/kotlin/com/wbrawner/twigs/web/user/UserWebRoutes.kt @@ -37,6 +37,14 @@ fun Application.userWebRoutes(userService: UserService) { } } } + + route("/logout") { + post { + call.sessions.clear() + call.respondRedirect("/") + } + } + route("/register") { get { call.respond(MustacheContent("register.mustache", RegisterPage())) diff --git a/web/src/main/resources/templates/partials/sidebar.mustache b/web/src/main/resources/templates/partials/sidebar.mustache index 7a1e695..db4f9d5 100644 --- a/web/src/main/resources/templates/partials/sidebar.mustache +++ b/web/src/main/resources/templates/partials/sidebar.mustache @@ -40,13 +40,12 @@ About Twigs - TODO: Implement logout -
  • - - Logout - -
  • --> +
  • +
    + +
    +
  • Source Code