This repository was archived by the owner on Nov 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 88 "encoding/json"
99 "errors"
1010 "github.com/gorilla/mux"
11+ "github.com/gorilla/securecookie"
1112 "github.com/gorilla/sessions"
1213 "github.com/markbates/goth"
1314 "github.com/markbates/goth/gothic"
@@ -29,6 +30,10 @@ var uiFs embed.FS
2930
3031const quesmaSessionName = "quesma-session"
3132
33+ func init () {
34+ gothic .Store = sessions .NewCookieStore (securecookie .GenerateRandomKey (32 ))
35+ }
36+
3237func authCallbackHandler (w http.ResponseWriter , r * http.Request ) {
3338 user , err := gothic .CompleteUserAuth (w , r )
3439 if err != nil {
@@ -247,7 +252,9 @@ func (qmc *QuesmaManagementConsole) initPprof(router *mux.Router) {
247252 router .HandleFunc ("/debug/pprof/trace" , pprof .Trace )
248253}
249254
250- var store = sessions .NewCookieStore ([]byte ("test" ))
255+ var authKey = securecookie .GenerateRandomKey (64 )
256+ var encryptionKey = securecookie .GenerateRandomKey (32 )
257+ var store = sessions .NewCookieStore (authKey , encryptionKey )
251258
252259func authMiddleware (next http.Handler ) http.Handler {
253260 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments