feat(security): #328 delete old sessions [tbs]
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 42s

This commit is contained in:
2024-12-17 22:21:46 +01:00
parent 086d373442
commit 3003e4f1bf
4 changed files with 87 additions and 42 deletions

View File

@@ -95,6 +95,7 @@ func NewAuthImpl(db db.Auth, random Random, clock Clock, mail Mail, serverSettin
}
func (service AuthImpl) SignIn(email string, password string) (*Session, error) {
log.Info("Sign in %s", email)
user, err := service.db.GetUserByEmail(email)
if err != nil {
if errors.Is(err, db.ErrNotFound) {
@@ -148,6 +149,7 @@ func (service AuthImpl) SignInSession(sessionId string) (*Session, error) {
}
func (service AuthImpl) SignInAnonymous() (*Session, error) {
log.Info("Sign in anonymous")
sessionDb, err := service.createSession(uuid.Nil)
if err != nil {
return nil, types.ErrInternal