Commits

Dobrosław Żybort committed d561b29

Handling wrong login password

Comments (0)

Files changed (1)

 import (
 	"bytes"
 	"code.google.com/p/go.crypto/scrypt"
+	"errors"
 )
 
 type User struct {
 		16384, 8, 1, 64)
 
 	if !bytes.Equal(user.Password, pass) {
-		user = nil
+		err = errors.New("Login: wrong password")
 	}
-	return user, nil
+	return user, err
 }