Skip to content

Commit

Permalink
Add cancel button to demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Aug 20, 2024
1 parent 6f6a797 commit 0c7fa74
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions example/oauth_access_token.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,35 @@
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
height: 100vh;
padding: 0;
margin: 0;
gap: 2em;
}

button#login {
padding: 1em 2em;
font-size: 16px;
align-self: center;
}

button#cancel {
padding: 0.5em 1em;
font-size: 12px;
align-self: center;
background: none;
border: none;
text-decoration: underline;
}
</style>
</head>
<body>
<button id="login">Click Here to Login</button>

<button id="cancel">Cancel</button>

<script>
// Polyfill for crypto.randomUUID()
if (!('randomUUID' in crypto)) {
Expand Down Expand Up @@ -67,6 +80,10 @@
document.getElementById('login').addEventListener('click', () => {
performOAuth();
});

document.getElementById('cancel').addEventListener('click', () => {
window.close();
});
</script>
</body>
</html>

0 comments on commit 0c7fa74

Please sign in to comment.