Skip to content

Instantly share code, notes, and snippets.

@mckiersey
Created March 14, 2021 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mckiersey/dcd9eb7f127195a5de1f2d1186b3cdce to your computer and use it in GitHub Desktop.
Save mckiersey/dcd9eb7f127195a5de1f2d1186b3cdce to your computer and use it in GitHub Desktop.
function signOut() {
var getUrl = `http://localhost:80/SignOut`
try {
$.get(getUrl, {})
.done(function (data) {
if (data = 'CookieDeleted') {
window.location.href = "http://localhost:80/LoggedOutPage"
} else {
alert('Something went wrong, please try to sign out again.')
}
});
} catch (err) {
console.log('failed to post to backend')
response.send('Error: ' + err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment