Substantially improved item libraries UI, locked behind Patreon tier 5

This commit is contained in:
Stefan Zermatten
2019-05-06 14:51:48 +02:00
parent d4864dda5f
commit 81a3ede86e
24 changed files with 493 additions and 248 deletions

View File

@@ -1,9 +1,5 @@
import { format as formatUrl } from 'url';
const CLIENT_ID = Meteor.settings &&
Meteor.settings.public.patreon &&
Meteor.settings.public.patreon.clientId;
Template.profile.onCreated(function(){
this.showApiKey = new ReactiveVar(false);
this.loadingPatreon = new ReactiveVar(false);
@@ -19,21 +15,6 @@ Template.profile.helpers({
showApiKey: function(){
return Template.instance().showApiKey.get();
},
patreonLoginUrl: function(){
if (!CLIENT_ID) return;
return formatUrl({
protocol: 'https',
host: 'patreon.com',
pathname: '/oauth2/authorize',
query: {
response_type: 'code',
client_id: CLIENT_ID,
redirect_uri: Meteor.absoluteUrl() + 'patreon-redirect',
state: Meteor.userId(),
scope: 'identity',
},
});
},
patreon: function(){
let user = Meteor.user();
return user && user.patreon || {};