- Clarified web handler name
- Implemented Configuration Loader with unauthorized error handling - More elaborate test user config - Use Viper Unmarshalling for User Config loading - Centralized password hasing code
This commit is contained in:
@ -9,7 +9,6 @@ import (
|
||||
"gitea.nehmer.net/torben/dyndns/service"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
@ -36,7 +35,7 @@ have to store a plaintext password.`,
|
||||
log.Fatalln("the passwords do not match.")
|
||||
}
|
||||
|
||||
hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
|
||||
hash, err := service.HashPassword(password)
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create password hash: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user