Forgot to move Token config
Tokens config are now in config/tokens.go
Cette révision appartient à :
Parent
3ec367a759
révision
bd59f3afd1
3 fichiers modifiés avec 10 ajouts et 6 suppressions
|
@ -23,6 +23,3 @@ const (
|
|||
// EmailTimeout : Timeout for waiting server response
|
||||
EmailTimeout = 10 * time.Second
|
||||
)
|
||||
|
||||
// EmailTokenHashKey : /!\ Email hash for generating email activation token /!\
|
||||
var EmailTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")
|
||||
|
|
7
config/tokens.go
Fichier normal
7
config/tokens.go
Fichier normal
|
@ -0,0 +1,7 @@
|
|||
package config
|
||||
|
||||
// EmailTokenHashKey : /!\ Email hash for generating email activation token /!\
|
||||
var EmailTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")
|
||||
|
||||
// CSRFTokenHashKey : /!\ CSRF hash for generating CSRF tokens /!\
|
||||
var CSRFTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")
|
4
main.go
4
main.go
|
@ -33,9 +33,9 @@ func RunServer(conf *config.Config) {
|
|||
|
||||
// Please make EnableSecureCSRF to false when testing locally
|
||||
if config.EnableSecureCSRF {
|
||||
http.Handle("/", csrf.Protect([]byte("q8satbudwexfzh2j3m5n6p8r9satcvsd"))(router.Router))
|
||||
http.Handle("/", csrf.Protect(config.CSRFTokenHashKey)(router.Router))
|
||||
} else {
|
||||
http.Handle("/", csrf.Protect([]byte("q8satbudwexfzh2j3m5n6p8r9satcvsd"), csrf.Secure(false))(router.Router))
|
||||
http.Handle("/", csrf.Protect(config.CSRFTokenHashKey, csrf.Secure(false))(router.Router))
|
||||
}
|
||||
// Set up server,
|
||||
srv := &http.Server{
|
||||
|
|
Référencer dans un nouveau ticket