fix: couple session deletion with user deletion

This commit is contained in:
Lakhan Samani
2022-07-12 08:42:32 +05:30
parent 1fe0d65874
commit bfbeb6add2
11 changed files with 32 additions and 55 deletions

View File

@@ -27,13 +27,3 @@ func (p *provider) AddSession(ctx context.Context, session models.Session) error
}
return nil
}
// DeleteSession to delete session information from database
func (p *provider) DeleteSession(ctx context.Context, userId string) error {
result := p.db.Where("user_id = ?", userId).Delete(&models.Session{})
if result.Error != nil {
return result.Error
}
return nil
}