mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
client/web: open new window if iframed
Previously, we were only breaking out of iframes when accessing the login client over a local IP address (where viewerIdentity is not set). We need to also handle the case where the user is accessing the login client over the Tailscale IP, and similarly break out of the iframe when logging into the management client. Updates #10261 Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
parent
501478dcdc
commit
e9f203d747
@ -126,7 +126,14 @@ function LoginPopoverContent({
|
|||||||
|
|
||||||
const handleSignInClick = useCallback(() => {
|
const handleSignInClick = useCallback(() => {
|
||||||
if (auth.viewerIdentity) {
|
if (auth.viewerIdentity) {
|
||||||
newSession()
|
if (window.self !== window.top) {
|
||||||
|
// if we're inside an iframe, start session in new window
|
||||||
|
let url = new URL(window.location.href)
|
||||||
|
url.searchParams.set("check", "now")
|
||||||
|
window.open(url, "_blank")
|
||||||
|
} else {
|
||||||
|
newSession()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Must be connected over Tailscale to log in.
|
// Must be connected over Tailscale to log in.
|
||||||
// Send user to Tailscale IP and start check mode
|
// Send user to Tailscale IP and start check mode
|
||||||
|
Loading…
Reference in New Issue
Block a user