Repair Tailscale authorization flow

This commit is contained in:
David Heinemeier Hansson
2026-07-17 10:20:08 -07:00
parent 47c5f12fb9
commit e6c0c0ce6f
3 changed files with 67 additions and 6 deletions
+9
View File
@@ -59,6 +59,14 @@ function accountLabel(account) {
return String(account.id || "Unknown account")
}
function loginPlan(needsLogin, authUrl) {
var url = String(authUrl || "").trim()
if (needsLogin === true && /^https?:\/\//.test(url)) {
return { authUrl: url, command: [] }
}
return { authUrl: "", command: ["tailscale", "up"] }
}
function peerFromStatus(id, peer) {
return {
id: id,
@@ -270,6 +278,7 @@ if (typeof module !== "undefined") {
displayHostName: displayHostName,
osIcon: osIcon,
accountLabel: accountLabel,
loginPlan: loginPlan,
isMullvadPeer: isMullvadPeer,
peerFromStatus: peerFromStatus,
parseExitNodeList: parseExitNodeList,