meteor

How can I get the credential secret in Meteor, when I do Facebook.requestCredential on the client?

时光怂恿深爱的人放手 提交于 2019-12-20 02:12:44
问题 I'm trying to implement a login/link account system like the one in this question. (scroll down to where it says "Methods for explicit associations") You used to be able to get the user's login data with something like this: data = Package.facebook.Facebook.retrieveCredential(token).serviceData Now it looks like this retrieveCredential(token, secret) . Here's the commit where that happened. I for the life of me can't figure out how to get the credential secret on the server after I call:

Uncaught Error: Not permitted. Untrusted code may only update documents by ID. [403]

孤者浪人 提交于 2019-12-20 01:45:12
问题 I have this error but it does not specify which code line is faulty. Is there any way I can narrow down which codes I need to focus on? Not sure if its a related problem, but when I submit a doc and its supposed to recognize my user.username , but it comes out blank when html displays {{author}} . The code for the collection (shared folder for both public/ server) is as below: var post = _.extend(postAttributes, { userId: user._id, author: user.username }); Do appreciate any help! Update: New

How to pass Reactive variables among different templates in Meteor?

心已入冬 提交于 2019-12-20 01:37:36
问题 I have 2 separate templates: <template name = "MusicControl"> <!-- Some Logics here --> </template> <template name = "MusicSystem"> <!-- Some Logics here ("click" event) --> </template> I have 2 JavaScript files associated with these 2 templates. What I want is that if an event occurs ( "click" event) on the MusicControl template, it sets some sort of global variable (but not Session variable) so that I can access it in another template as a helper function. How to implement in Reactive-Dict

Mongo gives duplicate key error on _id_ field in Meteor application

天大地大妈咪最大 提交于 2019-12-20 01:37:22
问题 I'm searching a long time and a lot of topics about this issue. Until now I couldn't find any solution. Moreover, it's not all clear to me, hopefully you can help. Here's my question: I designed a Meteor application and there is a collection in the Mongo DB with orders. That collection is filled by reading a csv file import_file_orders = function(file) { var lines = file.split('%\r\n'); var l = lines.length - 1; for (var i=0; i < l; i++) { var line = lines[i]; var line_parts = line.split('|')

Meteor callback to sys.exec inside a Meteor.call callback

╄→гoц情女王★ 提交于 2019-12-20 01:34:20
问题 I have an event triggering a Metor.call() : Meteor.call("runCode", myCode, function(err, response) { Session.set('code', response); console.log(response); }); But my runCode function inside the server's Metheor.methods has inside it a callback too and I can't find a way to make it return something to response in the above code. runCode: function(myCode) { var command = 'pwd'; child = exec(command, function(error, stdout, stderr) { console.log(stdout.toString()); console.log(stderr.toString())

Unsupported grant type error when requesting access_token on Spotify API with Meteor HTTP

試著忘記壹切 提交于 2019-12-19 18:28:44
问题 I've been unable to solve a problem while requesting an access_token on Spotify API with Meteor HTTP. Indeed, when I make a POST call to the Spotify https://accounts.spotify.com/api/token. I get the following response : {"statusCode":400,"content":"{\"error\":\"unsupported_grant_type\",\"error_description\":\"grant_type must be client_credentials, authorization_code or refresh_token\"}" I think this may have something to do with the Content-Type header and the encoding of the BODY parameter

How to execute a callback after an #each is done?

浪尽此生 提交于 2019-12-19 18:23:22
问题 I'm having trouble with a callback after the #each has finished. I have a template named "content": <template name="content"> {{#if Template.subscriptionsReady}} {{#each currentData}} <div data-cid="{{this._id}}"></div> {{/each}} {{else}} Loading... {{/if}} </template> At first I wait for a subscription, when this is available, I iterate through my Collection with {{#each}} and append the div . What I need is a sort of callback for when the for-each loop is done (in other words DOM ready).

Meta tag not in first 1024 bytes

不羁的心 提交于 2019-12-19 17:42:27
问题 Caveat: Before someone goes and marks this as duplicate of this, please understand that it is not. The accepted answer is exactly what I am doing, yet I am facing the following issue. HTML file in client folder looks like this: <head> <meta charset="utf-8"/> <title>blah-blah</title> --- The message I am getting in the firebug console is: The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently

Meta tag not in first 1024 bytes

无人久伴 提交于 2019-12-19 17:42:18
问题 Caveat: Before someone goes and marks this as duplicate of this, please understand that it is not. The accepted answer is exactly what I am doing, yet I am facing the following issue. HTML file in client folder looks like this: <head> <meta charset="utf-8"/> <title>blah-blah</title> --- The message I am getting in the firebug console is: The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently

How do I reload the current iron:router route?

淺唱寂寞╮ 提交于 2019-12-19 17:31:40
问题 If I'm currently at /foo , Router.go '/foo' does nothing. I would like /foo 's action hooks and rendering to be redone. I know I could make a dependency, mention it in an action hook, and invalidate it when I need to reload, I'm just hoping there's a Router.* api I can use, because that would be cleaner. 回答1: This adds a function Router.rerun() that works: login_dep = new Tracker.Dependency Router.rerun = -> login_dep.changed() Router.configure onBeforeAction: -> login_dep.depend() ... 回答2: