Fix up urls and unneeded import

This commit is contained in:
Amarpreet Minhas 2019-10-05 22:50:14 -04:00
parent 2fb9ad73d5
commit c2802b93ac
2 changed files with 2 additions and 3 deletions

View file

@ -172,9 +172,9 @@ func refresh(w http.ResponseWriter, r *http.Request) {
func setCookies(w http.ResponseWriter, jwt string, expiration time.Time) string {
splitToken := strings.Split(jwt, ".")
dataCookie := http.Cookie{Name: "DataCookie", Value: strings.Join(splitToken[:2], "."), Expires: expiration, HttpOnly: false, Path: "/", Domain: ".sudosci.test", MaxAge: 360, Secure: false}
dataCookie := http.Cookie{Name: "DataCookie", Value: strings.Join(splitToken[:2], "."), Expires: expiration, HttpOnly: false, Path: "/", Domain: ".sudoscientist.com", MaxAge: 360, Secure: false}
http.SetCookie(w, &dataCookie)
signatureCookie := http.Cookie{Name: "SignatureCookie", Value: splitToken[2], Expires: expiration, HttpOnly: true, Path: "/", Domain: ".sudosci.test", MaxAge: 360, Secure: false}
signatureCookie := http.Cookie{Name: "SignatureCookie", Value: splitToken[2], Expires: expiration, HttpOnly: true, Path: "/", Domain: ".sudoscientist.com", MaxAge: 360, Secure: false}
http.SetCookie(w, &signatureCookie)
return strings.Join(splitToken[:2], ".")
}

View file

@ -1,7 +1,6 @@
package auth_middleware
import (
"fmt"
"net/http"
)