aboutsummaryrefslogtreecommitdiff
path: root/service/transport.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-29 11:32:24 +0000
committerr <r@freesoftwareextremist.com>2019-12-29 11:32:24 +0000
commit9e556721c507f5cfbafa32afbfa80b70c6f0eca1 (patch)
tree20f00fa29a6425279359b34e6613f60d5fa315f6 /service/transport.go
parentede1bb42758d31e2537ba8545b3a403fc94f6cdb (diff)
downloadbloat-9e556721c507f5cfbafa32afbfa80b70c6f0eca1.tar.gz
bloat-9e556721c507f5cfbafa32afbfa80b70c6f0eca1.zip
Add default settings
Diffstat (limited to 'service/transport.go')
-rw-r--r--service/transport.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/service/transport.go b/service/transport.go
index bbf1f06..83eeedf 100644
--- a/service/transport.go
+++ b/service/transport.go
@@ -52,9 +52,9 @@ func NewHandler(s Service, staticDir string) http.Handler {
}
http.SetCookie(w, &http.Cookie{
- Name: "session_id",
- Value: sessionID,
- Expires: time.Now().Add(365 * 24 * time.Hour),
+ Name: "session_id",
+ Value: sessionID,
+ Expires: time.Now().Add(365 * 24 * time.Hour),
})
w.Header().Add("Location", url)
@@ -354,9 +354,11 @@ func NewHandler(s Service, staticDir string) http.Handler {
visibility := req.FormValue("visibility")
copyScope := req.FormValue("copy_scope") == "true"
+ threadInNewTab := req.FormValue("thread_in_new_tab") == "true"
settings := &model.Settings{
DefaultVisibility: visibility,
CopyScope: copyScope,
+ ThreadInNewTab: threadInNewTab,
}
err := s.SaveSettings(ctx, w, nil, settings)
@@ -372,9 +374,9 @@ func NewHandler(s Service, staticDir string) http.Handler {
r.HandleFunc("/signout", func(w http.ResponseWriter, req *http.Request) {
// TODO remove session from database
http.SetCookie(w, &http.Cookie{
- Name: "session_id",
- Value: "",
- Expires: time.Now(),
+ Name: "session_id",
+ Value: "",
+ Expires: time.Now(),
})
w.Header().Add("Location", "/")
w.WriteHeader(http.StatusFound)