Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.4 #22

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions src/examples/SingleSignOn/SingleSignOn.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,12 @@ export const createSSoForm = () => {
// This section of code is the "Form Controller"
form.on("submitDone", function submitDoneCleanup(submission) {
console.info("submission", submission);
// remove form.io api tokens after submission for security
localStorage.removeItem(`${namespace}Token`);
localStorage.removeItem(`${namespace}User`);

window.location =
"https://uat.auth.qld.gov.au/auth/realms/tell-us-once/protocol/openid-connect/logout";

function afterTimeout() {
// logout the user for security
const logoutUrl =
"https://uat.auth.qld.gov.au/auth/realms/tell-us-once/protocol/openid-connect/logout";
// maintain login for office 365 accounts

// add your own URL encoded confirmation page URL here in place of window.location.href.split('#')[0];
const returnUiParams = "?submitted";
let params = `?redirect_uri=${encodeURI(
window.location.href.split("#")[0] + returnUiParams
)}`;

if (user.data.idp_type && user.data.idp_type === "employee") {
params += "&initiating_idp=o365";
}
window.location.href = logoutUrl + params;
}

setTimeout(afterTimeout, 500000); // Logout after 500 seconds
Formio.logout(form.formio, {
namespace,
}).then(() => {
window.location.reload();
});
});
};

Expand Down