Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created July 9, 2025 03:23
Show Gist options
  • Select an option

  • Save KyMidd/1d7c6ba79141975018c5547e06ff7134 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/1d7c6ba79141975018c5547e06ff7134 to your computer and use it in GitHub Desktop.
def build_autoclose_page():
html = """
<!DOCTYPE html>
<html>
<head>
<title>Authentication Complete</title>
<script>
window.onload = function() {
if (window.opener) {
window.opener.postMessage("authComplete", "*");
}
window.close();
setTimeout(function() {
window.location.href = "msteams://teams.microsoft.com";
}, 1000);
};
</script>
</head>
<body>
<p>Successfully logged in, you can close this window.</p>
</body>
</html>
"""
# Return the html
return html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment