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