2018-11-21 04:13:34 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
|
|
|
|
|
|
|
const logoutRouteHandler = () => {
|
|
|
|
Auth.logout()
|
2020-10-08 17:15:05 +08:00
|
|
|
.then((logoutURL) => {
|
|
|
|
if (logoutURL) {
|
|
|
|
const protocolPattern = /^((http|https):\/\/)/;
|
|
|
|
window.location.href = protocolPattern.test(logoutURL) ? logoutURL : `http://${logoutURL}`;
|
|
|
|
}
|
2018-11-21 04:13:34 +08:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default logoutRouteHandler;
|