Feat: styles and session
This commit is contained in:
@ -6,17 +6,10 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"golias/config"
|
||||
"golias/pkg/cache"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
cfg config.Config
|
||||
memcache cache.Cache
|
||||
)
|
||||
|
||||
// responseWriterWrapper wraps http.ResponseWriter to capture status code
|
||||
type responseWriterWrapper struct {
|
||||
http.ResponseWriter
|
||||
@ -99,6 +92,8 @@ func GetSession(next http.Handler) http.Handler {
|
||||
}
|
||||
ctx := context.WithValue(r.Context(),
|
||||
"username", userSession.Username)
|
||||
ctx = context.WithValue(r.Context(),
|
||||
"session", userSession)
|
||||
if err := cacheSetSession(sessionToken,
|
||||
userSession); err != nil {
|
||||
msg := "failed to marshal user session"
|
||||
|
Reference in New Issue
Block a user