14 lines
359 B
JavaScript
14 lines
359 B
JavaScript
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;
|