Skip to content

Commit

Permalink
feat: extend Parcel with revoke access token
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Nov 24, 2021
1 parent 9108a44 commit dcde654
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions samples/Parcel/src/code-flow-identityserver/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<button id="getUser">get user</button>
<button id="removeUser">remove user</button>
<button id="querySessionStatus">query user status at token server</button>
<button id="revokeAccessToken">revoke access token</button>
</div>
<div>
<button id="startSigninMainWindow">start signin main window</button>
Expand Down
25 changes: 17 additions & 8 deletions samples/Parcel/src/code-flow-identityserver/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ document.getElementById("clearState").addEventListener("click", clearState, fals
document.getElementById("getUser").addEventListener("click", getUser, false);
document.getElementById("removeUser").addEventListener("click", removeUser, false);
document.getElementById("querySessionStatus").addEventListener("click", querySessionStatus, false);
document.getElementById("revokeAccessToken").addEventListener("click", revokeAccessToken, false);

document.getElementById("startSigninMainWindow").addEventListener("click", startSigninMainWindow, false);
document.getElementById("endSigninMainWindow").addEventListener("click", endSigninMainWindow, false);
Expand Down Expand Up @@ -114,6 +115,22 @@ function removeUser() {
});
}

function querySessionStatus() {
mgr.querySessionStatus().then(function(status) {
log("user's session status", status);
}).catch(function(err) {
log(err);
});
}

function revokeAccessToken() {
mgr.revokeAccessToken().then(function() {
log("access token revoked");
}).catch(function(err) {
log(err);
});
}

function startSigninMainWindow() {
mgr.signinRedirect(/*{useReplaceToNavigate:true}*/).then(function() {
log("signinRedirect done");
Expand Down Expand Up @@ -158,14 +175,6 @@ function iframeSignin() {
});
}

function querySessionStatus() {
mgr.querySessionStatus().then(function(status) {
log("user's session status", status);
}).catch(function(err) {
log(err);
});
}

function startSignoutMainWindow() {
mgr.signoutRedirect().then(function(resp) {
log("signed out", resp);
Expand Down

0 comments on commit dcde654

Please sign in to comment.