bigbluebutton-Github/bigbluebutton-html5/imports/utils/logoutRouteHandler.js

14 lines
359 B
JavaScript
Raw Normal View History

import Auth from '/imports/ui/services/auth';
const logoutRouteHandler = () => {
Auth.logout()
.then((logoutURL) => {
if (logoutURL) {
const protocolPattern = /^((http|https):\/\/)/;
window.location.href = protocolPattern.test(logoutURL) ? logoutURL : `http://${logoutURL}`;
}
});
};
export default logoutRouteHandler;