diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
| commit | ecc6a55aba7bb35fc778e7a53848396b88214151 (patch) | |
| tree | 1b37a2dc5f4594155114da1ae0c4529d20a4c548 /pkg/session | |
| parent | 8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (diff) | |
Add multiple conferences feature
Diffstat (limited to 'pkg/session')
| -rw-r--r-- | pkg/session/memory.go | 3 | ||||
| -rw-r--r-- | pkg/session/service.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/pkg/session/memory.go b/pkg/session/memory.go index f02b792..8fa6076 100644 --- a/pkg/session/memory.go +++ b/pkg/session/memory.go @@ -40,7 +40,7 @@ func (s *memoryStore) GetBySID(sid uint) *UserSession { return s.sessionsBySID[sid] } -func (s *memoryStore) Create(uid int32, username string, ip string, ua string) (*UserSession, error) { +func (s *memoryStore) Create(uid int32, username string, ip string, ua string, admin bool) (*UserSession, error) { token := generateSessionToken() s.lock.Lock() @@ -65,6 +65,7 @@ func (s *memoryStore) Create(uid int32, username string, ip string, ua string) ( IP: ip, UserAgent: ua, LoginTime: time.Now(), + Admin: admin, } s.sessionsByToken[token] = session s.sessionsBySID[sessionId] = session diff --git a/pkg/session/service.go b/pkg/session/service.go index 83009bc..a693fe8 100644 --- a/pkg/session/service.go +++ b/pkg/session/service.go @@ -5,7 +5,7 @@ import "time" type Service interface { GetByToken(token string) *UserSession GetBySID(sid uint) *UserSession - Create(uid int32, username string, ip string, ua string) (*UserSession, error) + Create(uid int32, username string, ip string, ua string, admin bool) (*UserSession, error) Destroy(sid uint) error } @@ -17,4 +17,5 @@ type UserSession struct { IP string LoginTime time.Time UserAgent string + Admin bool } |
