From 0e4cb88bb5c8e45e1c92bcea9f9f8e2e64a68a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 14 Dec 2021 14:29:59 +0100 Subject: [PATCH] wip --- source/_assets/js/extsb.js | 31 ++++++++++------------------- source/_layouts/master.blade.php | 2 +- source/assets/build/js/extsb.js | 2 +- source/assets/build/js/extsb.js.map | 2 +- source/gr_redirect.blade.php | 13 ++++++++++++ 5 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 source/gr_redirect.blade.php diff --git a/source/_assets/js/extsb.js b/source/_assets/js/extsb.js index 43dc04c..adf120c 100644 --- a/source/_assets/js/extsb.js +++ b/source/_assets/js/extsb.js @@ -1,25 +1,16 @@ import splitbee from '@splitbee/web'; -(function (tag) { - if (! tag) { - return; - } +splitbee.init({ + scriptUrl: "https://tenancyforlaravel.com/bee.js", + apiUrl: "https://tenancyforlaravel.com/_hive", +}) - let data = tag.dataset; - if (! data.token) { - return; - } +window.auth = function (username) { + if (! username) return window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate'); - splitbee.init({ - scriptUrl: "https://tenancyforlaravel.com/bee.js", - apiUrl: "https://tenancyforlaravel.com/_hive", - token: data.token, - }) - - splitbee.enableCookie(); - splitbee.user.set({github: data.github}); - splitbee.track('Purchase', { - product: data.product, - price: data.price, + splitbee.user.set({ + userId: username.substr(1), + }).finally(() => { + window.location.replace('https://github.com/tenancy-for-laravel/saas-boilerplate'); }); -})(document.getElementById('extsb')); +} diff --git a/source/_layouts/master.blade.php b/source/_layouts/master.blade.php index 3b799ad..e6f5626 100644 --- a/source/_layouts/master.blade.php +++ b/source/_layouts/master.blade.php @@ -37,7 +37,7 @@ {{ ($title ?? null) ? $title . ' | Tenancy for Laravel' : 'Tenancy for Laravel' }} - +