meteor-accounts

Meteor Promises in Accounts.onCreateUser

我是研究僧i 提交于 2019-12-10 11:27:38
问题 I would like to create a stripe account during the user registration in meteor and adjusted Accounts.onCreateUser for that purpose with a promise. Accounts.onCreateUser((options, user) => { if (user.services.facebook) { const { first_name, last_name, email } = user.services.facebook; user.profile = {} user.profile.first_name = first_name user.profile.last_name = last_name } else{ user.profile = options.profile } user.stripe = {} return new Promise((resolve,reject) => { stripe.customers.create

MeteorJs “loginWIthPassword” seems not to work in method

自作多情 提交于 2019-12-10 04:44:08
问题 It seems that the "Meteor.loginWithPassword" function does not work when called in a method. I want to create my login form with autoforms and so I created a callback method which get called after a user submitted the login form. The form gets called the right way but the loginWithPassword function does not seems to work. This is my method (on Client & Server side) Meteor.methods({ autoform_test_login : function (doc) { console.log('Called login method'); if (Meteor.isClient) { Meteor

Useraccounts updated to Useraccounts:iron-routing

守給你的承諾、 提交于 2019-12-08 10:21:51
问题 updated my meteor app and had useraccounts on it and it suddenly told me to install the useraccounts:iron-routing to use it with Iron Router... Installed the package and now its telling me W20150818-19:23:20.744(-6)? (STDERR) Error: changePwd route configured but enablePasswordChange set to false! and won't start my app, but my AccountsTemplates.configure({ has all seted to true... here is the code: //Routes AccountsTemplates.configureRoute('changePwd'); AccountsTemplates.configureRoute(

How to apply Tracker.autorun? Meteor.userId() undefined right after refreshing page

会有一股神秘感。 提交于 2019-12-08 07:04:43
问题 I have a restricted page using Meteor.userId() and roles: class AdminPage extends Component { render() { return ( <div> { Roles.userIsInRole(Meteor.userId(), 'admin') ? ( <Master_Layout renderCenter={<Article_Editor />}/> ) : browserHistory.push('/') } </div> ) } } This code redirects user to "/" after refresh because Meteor.userId() is undefined. How do I make sure Meteor.userId() is not undefined before rendering the page after refresh? I searched for answers. I found Tracker.autorun as a

Meteor takes time to know if there's a {{currentUser}} or not

六月ゝ 毕业季﹏ 提交于 2019-12-07 06:33:35
问题 I've a few code that I want to run only when there's noUser and a few when there's a currentUser . All these are inside the navigation template. Like so... {{#if currentUser}} <li class="nav"><a href="{{pathFor 'create'}}">Post</a> </li> <li class="nav"><a>Ola, {{thisUser}}!</a> </li> <li class="nav"><a href="#" id="logout">Log Out</a> </li> {{/if}} {{#if noUser}} <li class="nav"><a href="{{pathFor 'signup'}}">Sign Up</a> </li> <li class="nav"><a href="{{pathFor 'login'}}">Login</a> </li> {{

How to apply Tracker.autorun? Meteor.userId() undefined right after refreshing page

我怕爱的太早我们不能终老 提交于 2019-12-06 16:41:40
I have a restricted page using Meteor.userId() and roles: class AdminPage extends Component { render() { return ( <div> { Roles.userIsInRole(Meteor.userId(), 'admin') ? ( <Master_Layout renderCenter={<Article_Editor />}/> ) : browserHistory.push('/') } </div> ) } } This code redirects user to "/" after refresh because Meteor.userId() is undefined. How do I make sure Meteor.userId() is not undefined before rendering the page after refresh? I searched for answers. I found Tracker.autorun as a solution, but I did not understand how to apply it. Thank you for help. I updated the code: constructor

Meteor - Facebook authorization simply isn't working

房东的猫 提交于 2019-12-06 12:48:01
问题 I'm running a meteor app from a server at http://example.com:3000 and trying to get it to authorize via Facebook using accounts-facebook . My HTML looks like this: <head> <title>appname</title> </head> <body> <h1>Welcome to Meteor!</h1> {{> hello}} </body> <template name="hello"> <button>Click Me</button> {{>loginButtons}} {{#if currentUser}} Logged in {{/if}} </template> I do have accounts-ui and accounts-facebook enabled. I went through the Facebook app registration process. Here are my

Meteor Facebook login (Meteor.loginWithFacebook) issue extracting public profile, email and user_friends

回眸只為那壹抹淺笑 提交于 2019-12-06 10:01:30
问题 Trying to get Meteor Facebook login to work. It functions fully in that it uses Facebook API and requests the correct permissions from the users account and then logs in successfully. The problem is it doesn't save the permission requested information even though its been approved and only the basic name and ID are available in Meteor.user().services.facebook. Is this code not working because it's not saving the users details on login? I can't find a resource that details how to save or

How can I set forbidClientAccountCreation to false in Meteor?

可紊 提交于 2019-12-06 08:38:06
问题 The default setting in Meteor does not allow account creation from the Client, which makes sense for security purposes in many applications, but I am building a blog and need to allow users to create an account so they can leave comments. The typical response on github, stackoverflow, and various tutorials seems to suggest adding the following code to your files, anywhere outside of the client/server conditionals, so that it can run on both client AND server: Accounts.config({

MeteorJs “loginWIthPassword” seems not to work in method

折月煮酒 提交于 2019-12-05 11:30:47
It seems that the "Meteor.loginWithPassword" function does not work when called in a method. I want to create my login form with autoforms and so I created a callback method which get called after a user submitted the login form. The form gets called the right way but the loginWithPassword function does not seems to work. This is my method (on Client & Server side) Meteor.methods({ autoform_test_login : function (doc) { console.log('Called login method'); if (Meteor.isClient) { Meteor.loginWithPassword('test', 'test', function(e) { if (e) { console.log(e); } }); } } }); My autoforms calls this