mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
fix: log in with different use should create new machine entry
This commit is contained in:
@@ -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
@@ -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...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user