INNER CODE UNIT · Go
Login
GGP1/kure · auth/auth.go:35
func Login(db *bolt.DB) error {
// If auth is not nil it means the user is already logged in (session)
if auth := config.Get(authKey); auth != nil {
return nil
}
params, err := authDB.GetParams(db)
if err != nil {
return err
}
// The auth key will be nil only on the user's first (successful) command
if params.AuthKey == nil {
return Register(db, os.Stdin)
}
password, err := terminal.ScanPassword("Enter master password", false)
if err != nil {
return err