You can now login / change passwords / etc. again.

Fixed the installer.

Shadow theme is still borked.
This commit is contained in:
Azareal 2018-05-27 20:16:43 +10:00
parent 80ba8e2134
commit 55c10e0da2
2 changed files with 2 additions and 8 deletions

View File

@ -93,12 +93,6 @@ func (auth *DefaultAuth) Authenticate(username string, password string) (uid int
return 0, ErrSecretError
}
if salt == "" {
// Send an email to admin for this?
LogError(errors.New("Missing salt for user #" + strconv.Itoa(uid) + ". Potential security breach."))
return 0, ErrSecretError
}
err = CheckPassword(realPassword, password, salt)
if err == ErrMismatchedHashAndPassword {
return 0, ErrWrongPassword
@ -209,7 +203,7 @@ func CheckPassword(realPassword string, password string, salt string) (err error
blasted := strings.Split(realPassword, "$")
prefix := blasted[0]
if len(blasted) > 1 {
prefix += blasted[1]
prefix += "$" + blasted[1] + "$"
}
algo, ok := HashPrefixes[prefix]
if !ok {

View File

@ -18,7 +18,7 @@ func GenerateSafeString(length int) (string, error) {
// Generate a bcrypt hash
// Note: The salt is in the hash, therefore the salt value is blank
func bcryptGeneratePassword(password string) (hash string, salt string, err error) {
func BcryptGeneratePassword(password string) (hash string, salt string, err error) {
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
if err != nil {
return "", "", err