0
votes

We currently use Metoer with OAuth and Iron Router.

My problem is that I want to differentiate between login and register using social media. I will use Facebook as an example to detail my needs:

1) I do not want to let new users register via Facebook on my normal URL.

2) I generate URLs and present login/register on these. Here I WANT to let new users register.

So what I have tried to do so far is to differentiate on URLs, or find a way to make two different function calls where one opens for new accounts, and the other does not.

I.e. I need a way to stop the account process, in some instances, if the account package test of a matching local account fails, but I can't find where and when to do this.

As I currently understand the Meteor account packages for Facebook, using loginWithFacebook() will create an account after successfully checking FB credentials, if none is present in our Meteor Application.

Has anyone else had this problem, or do you have an idea of how to accomplish this kind of differentiating login and registrations via social media accounts?

1

1 Answers

0
votes

If you want to disable registering for new users, but allow existing users to log in, just use this server-side code.

Accounts.validateNewUser(function (user) {
  return false;
});

http://docs.meteor.com/#/full/accounts_validatenewuser