fix: log in with different use should create new machine entry

This commit is contained in:
Johan Siebens
2024-02-10 10:04:44 +01:00
parent 46cce89e0e
commit b098562988
7 changed files with 56 additions and 6 deletions
+7
View File
@@ -2,6 +2,7 @@ package tsn
import (
"slices"
"strings"
"tailscale.com/ipn/ipnstate"
"tailscale.com/tailcfg"
"tailscale.com/types/views"
@@ -27,6 +28,12 @@ func HasTag(tag string) Condition {
}
}
func HasName(name string) Condition {
return func(status *ipnstate.Status) bool {
return status.Self != nil && strings.HasPrefix(status.Self.DNSName, name)
}
}
func NeedsMachineAuth() Condition {
return func(status *ipnstate.Status) bool {
return status.BackendState == "NeedsMachineAuth"
+1 -1
View File
@@ -47,7 +47,7 @@ func (t *TailscaleNode) LoginWithOidc(flags ...UpFlag) (int, error) {
return strings.Contains(stderr, "To authenticate, visit:")
}
cmd := []string{"up", "--login-server", t.loginServer}
cmd := []string{"login", "--login-server", t.loginServer}
for _, f := range flags {
cmd = append(cmd, f...)
}