-
-
+
+
Login - Track Me
+
+
+
+
+
+
+
-
-
+
`)
return
@@ -66,6 +87,15 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
return
+ } else if r.URL.Path == "logout" {
+ sess.LoggedIn = false
+ sess.State = ""
+ sess.Me = ""
+ sess.AuthorizationEndpoint = ""
+ sess.NextURI = ""
+ sess.RedirectURI = ""
+ http.Redirect(w, r, "/", 302)
+ return
}
} else if r.Method == http.MethodPost {
r.ParseForm()
diff --git a/main.go b/main.go
index 5ce5241..157d877 100644
--- a/main.go
+++ b/main.go
@@ -23,13 +23,14 @@ var indexPageTemplate = `
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
Add moments of your day
-
+
Logged in as: {{ .Me }} | Logout
+
Remember moments: N minutes since your last memo