client/web: skip check mode for non-tailscale.com control servers (#10413)

client/web: skip check mode for non-tailscale.com control servers

Only enforce check mode if the control server URL ends in
".tailscale.com".  This allows the web client to be used with headscale
(or other) control servers while we work with the project to add check
mode support (tracked in juanfont/headscale#1623).

Updates #10261

Co-authored-by: Sonia Appasamy <sonia@tailscale.com>
Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris
2023-11-29 08:44:48 -08:00
committed by GitHub
parent ab0e25beaa
commit 26db9775f8
3 changed files with 87 additions and 27 deletions

View File

@@ -58,10 +58,10 @@ export default function useAuth() {
.then((d) => {
if (d.authUrl) {
window.open(d.authUrl, "_blank")
// refresh data when auth complete
apiFetch("/auth/session/wait", "GET").then(() => loadAuth())
return apiFetch("/auth/session/wait", "GET")
}
})
.then(() => loadAuth())
.catch((error) => {
console.error(error)
})