Add web session management

This commit is contained in:
Matt Baer
2018-10-16 20:30:38 -04:00
parent af601d7b0c
commit 62abc11142
5 changed files with 196 additions and 1 deletions

View File

@@ -5,13 +5,18 @@ import (
)
type keychain struct {
cookieAuthKey, cookieKey []byte
emailKey, cookieAuthKey, cookieKey []byte
}
func initKeys(app *app) error {
var err error
app.keys = &keychain{}
app.keys.emailKey, err = ioutil.ReadFile("keys/email.aes256")
if err != nil {
return err
}
app.keys.cookieAuthKey, err = ioutil.ReadFile("keys/cookies_auth.aes256")
if err != nil {
return err