summaryrefslogtreecommitdiffstats
path: root/app/login.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-02-20 12:49:45 -0800
committerGitHub <noreply@github.com>2018-02-20 12:49:45 -0800
commit75d9a3a3b99d0acafb6783a721a35ab1ccdd8d9d (patch)
treee362a6a112af73c8b5d9c7739753751429903a26 /app/login.go
parentfebc129ecaa2a0ca8c6f8deeac654cb296b2b436 (diff)
downloadchat-75d9a3a3b99d0acafb6783a721a35ab1ccdd8d9d.tar.gz
chat-75d9a3a3b99d0acafb6783a721a35ab1ccdd8d9d.tar.bz2
chat-75d9a3a3b99d0acafb6783a721a35ab1ccdd8d9d.zip
MM-8681 Adding config settings necessary for using CloudFront. (#8307)
* Adding config settings nessisary for using CloudFront. * Adding new config settings to diagnostics.
Diffstat (limited to 'app/login.go')
-rw-r--r--app/login.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/login.go b/app/login.go
index ecc0f0163..e01566bcd 100644
--- a/app/login.go
+++ b/app/login.go
@@ -113,6 +113,7 @@ func (a *App) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User,
secure = true
}
+ domain := a.GetCookieDomain()
expiresAt := time.Unix(model.GetMillis()/1000+int64(maxAge), 0)
sessionCookie := &http.Cookie{
Name: model.SESSION_COOKIE_TOKEN,
@@ -121,6 +122,7 @@ func (a *App) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User,
MaxAge: maxAge,
Expires: expiresAt,
HttpOnly: true,
+ Domain: domain,
Secure: secure,
}
@@ -130,6 +132,7 @@ func (a *App) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User,
Path: "/",
MaxAge: maxAge,
Expires: expiresAt,
+ Domain: domain,
Secure: secure,
}