feat(security): #286 fix test
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 51s

This commit is contained in:
2024-12-08 23:21:29 +01:00
parent c9e0188b60
commit 9e060b6f12
8 changed files with 81 additions and 717 deletions

View File

@@ -128,10 +128,14 @@ func (service AuthImpl) SignInSession(sessionId string) (*Session, error) {
return nil, types.ErrInternal
}
if sessionDb.ExpiresAt.After(service.clock.Now()) {
if sessionDb.ExpiresAt.Before(service.clock.Now()) {
return nil, nil
}
if sessionDb.UserId == uuid.Nil {
return NewSession(sessionDb, nil), nil
}
userDb, err := service.db.GetUser(sessionDb.UserId)
if err != nil {
return nil, types.ErrInternal