Fix All() for postgres store
This commit is contained in:
		@@ -73,9 +73,11 @@ func (s *PostgresStore) All() ([]models.LoginAttempt, error) {
 | 
			
		||||
	var attempts []models.LoginAttempt
 | 
			
		||||
	for rows.Next() {
 | 
			
		||||
		var a models.LoginAttempt
 | 
			
		||||
		if err := rows.Scan(&a.Date, &a.RemoteIP, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil {
 | 
			
		||||
		var ip string
 | 
			
		||||
		if err := rows.Scan(&a.Date, &ip, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
		a.RemoteIP = net.ParseIP(ip)
 | 
			
		||||
		attempts = append(attempts, a)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user