Giter Club home page Giter Club logo

meteor-link-accounts's People

Contributors

0xpatrickdev avatar acemtp avatar agustinjch avatar bitomule avatar chongwang87 avatar cookpete avatar dependabot[bot] avatar garbolino avatar gbhrdt avatar harveysanders avatar hashcutdev avatar jankapunkt avatar jfraboni avatar joshleblanc avatar lgtm-migrator avatar marco129 avatar michaeljcole avatar mike1pol avatar peernohell avatar ramezrafla avatar storytellercz avatar violetacalvo avatar yubozhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-link-accounts's Issues

unlink accounts

It would be nice to have an API to remove linked accounts from the meteor db,
something like:

Meteor.unlinkFacebook()
Meteor.unlinkTwitter()

etc.

Twitter is not defined

Hi there,

Trying this with Meteor 1.0. When I try to use

Meteor.linkWithTwitter();

I get:

2Uncaught ReferenceError: Twitter is not defined in twitter.js on line 15, which is:

Twitter.requestCredential(options, credentialRequestCompleteCallback);

I figure something changed in Meteor 1.0 that made this happen, but I couldn't figure out where in their source code to look to see why Twitter isn't being defined anymore. Any thoughts?

[Edit: just to point it out, I do definitely have accounts-twitter installed and configured using accounts-ui.]

Multple users being created

I followed the example exactly using a brand new project and [email protected], and it appears if I first create an account using accounts-password and then try to link with accounts-github, a second user is created, and I am logged in with that user. db.users.count() in mongo initially returns 1 user and then returns 2 users after I link with github.

It seems to work when using [email protected]

No error thrown when a social account is already in use

The package does not return an error when we try to link a social account that has been already used in another user. Instead, we receive a server-side exception: "Exception while invoking method 'login' MongoError: E11000 duplicate key error index".
It would be great if a Meteor.error is returned, so that it can be displayed in the client side of the site.

Can't use accounts-facebook and facebook package together

When trying to call Meteor.linkWithFacebook, I get an uncaught error saying

Please include accounts-facebook and facebook package or cordova-fb package [403]

But including both the accounts-facebook and facebook packages results in a crash of the Meteor app, with Meteor saying

Error: Already registered the facebook OAuth service
at Object.OAuth.registerService (packages/oauth.js:65:11)
at packages/facebook-oauth.js:49:7
at packages/facebook-oauth.js:125:4
at packages/facebook-oauth.js:137:3

Maybe this line in bozhao_link-accounts/core-services/facebook.js

if(!Package['accounts-facebook'] || !Package['facebook']) { throw new Meteor.Error(403, 'Please include accounts-facebook and facebook package or cordova-fb package') }

should insead be

if(!Package['accounts-facebook'] && !Package['facebook']) { throw new Meteor.Error(403, 'Please include accounts-facebook and facebook package or cordova-fb package') }

?

Right now, I have no way to call Meteor.linkWithFacebook()

Support for 'redirect' login style

Packages used:

bozhao:link-accounts
zhaoyao91:accounts-wechat-mp
zhaoyao91:short-oauth-state

Wechat-MP (公众号) uses 'redirect' login style. When linking, it always creates a new account instead of linking to the existing user. Any thoughts?

Here is how I call link:

linkWithWechatMP({ Meteor }, options, callback) {
    if (!Meteor.userId()) {
      throw new Meteor.Error(402, 'Please login to an existing account before link.');
    }
    if (!Package[ 'zhaoyao91:accounts-wechat-mp' ]) {
      throw new Meteor.Error(403, 'Please include zhaoyao91:accounts-wechat package')
    }
    if (!callback && typeof options === "function") {
      callback = options;
      options = null;
    }
    var credentialRequestCompleteCallback = Accounts.oauth.linkCredentialRequestCompleteHandler(callback);
    WeChatMP.requestCredential(options, credentialRequestCompleteCallback);
  },

Is it compatible with okland/accounts-phone?

My app is going to use whatsapp-style authentication (okland/accounts-phone) and Facebook authentication (accounts-facebook). Is it possible to link both with meteor-link-accounts?

Facebook link stopped working

I have

accounts-facebook                      1.0.6  Login service for Facebook accounts
bozhao:link-accounts                   1.1.12  Meteor external service link system
facebook                               1.2.2  Facebook OAuth flow
Error: Please include accounts-facebook and facebook package or cordova-fb package [403]
linkWithFacebookfacebook.js:7
click button.linkServicesettingsController.coffee:92
(anonymous function)blaze.js:87
withValuedynamics_browser.js:22
onTrackingstore.js:22
(anonymous function)blaze.js:86
(anonymous function)template.js:482
_withTemplateInstanceFunctemplate.js:456
(anonymous function)template.js:481
(anonymous function)view.js:883
_withCurrentViewview.js:537
(anonymous function)view.js:882
(anonymous function)events.js:46
dispatchjquery.js:4664
handlejquery.js:4332

linkWithDiscord error

Running the following:

    Meteor.linkWithDiscord({
      requestPermissions: ['identify', 'email', 'connections', 'guilds']
    });

results in the following:

Uncaught TypeError: Cannot read property 'requestCredential' of undefined
    at Object.Meteor.linkWithDiscord (discord.js:18)

linkWithfacebook creating new user

Hello,

I currently require users to create an email/password based account, and then link their twitter, google, and facebook accounts if they wish. Currently, linkWithTwitter and linkWithGoogle work fine, automatically linking those accounts when called. However, when linkWithFacebook is called, it creates a separate user account instead of linking it with the currently logged-in user. No error is thrown either so I can't figure out where things are going wrong.

I'm currently using the following package versions:
accounts-facebook 1.0.6* Login service for Facebook accounts
accounts-google 1.0.6* Login service for Google accounts
accounts-password 1.1.4* Password support for accounts
accounts-twitter 1.0.6* Login service for Twitter accounts
bozhao:link-accounts 1.2.9 Meteor external service link system

My code:

        Meteor.linkWithFacebook(function(error) {
            if (error) {
                $("#facebook-alert").prepend(error.message);
                $("#facebook-alert").show();
            }
            else {
                $("#facebook-alert").hide();
            };
        });

This seems similar to a previous issue posted at: https://github.com/yubozhao/meteor-link-accounts/issues/18. However, that error was apparently never resolved and it looks like it's biting me as well :-)

Any help is greatly appreciated. Thanks!

Add onLink hook similar to Meteor's onLogin

I use Meteor's onLogin to grab a list of Facebook and Instagram friends. I know it's not strictly necessary, but it would be a very nice feature to have a server-side onLink hook so I can make API calls this way.

Need detailed documentation about how to use this package in an Meteor Application

Hi,

I have an app made with meteor running and I have meteor's account-password package to create user accounts on it.
Now I want to add other social medium platforms (especially GitHub) to access the same account in the App.
I came across to your package.
Unfortunately, the documentation is not detailed enough for me to understand how to incorporate your package into the meteor app and start using it to add alternative login platforms for the same account.
I tried looking for npm command to install the package, but couldn't fine any.
Could you update the documentation, or provide me with a link where there are detailed instructions and usecases for this package?

Thanks.

problem linking to GitHub

My app allows login with Google, GitHub and Twitter. That works fine. I added this package to allow linking an existing account with other accounts. Google works fine. When I call

 Meteor.linkWithGithub();

I get

Uncaught TypeError: Cannot read property 'redirectUrl' of undefinedGithub.requestCredential @     github_client.js:33

Is there some configuration required for GitHub? What could be the problem?

Any dependency required

Hey,

I can't make it work, with a 'Facebook is not defined' error.
Not sure I properly installed the necessary package though.
I currently have accounts-ui, accounts-facebook installed

What package should I install/remove to make it work with Facebook ?
Sorry to bother you but it's not clear to me...

Propagate server error to client

hi, on server i got message Exception while invoking method 'login' MongoError: E11000 duplicate key error index: meteor.users.$services.twitter.id_1 dup key: { : "3822176249" } BUT in client i see only "Internal server error [500]" so i can't tell user that his twitter account is already connected to other user account...

can you pls propagate mongo server error to the client?

Before mergin callback

Hi, the issue is that when the user logs in with gmail for example then logs out, the next time he will pick another service like facebook but this time he will try and merge google account with the current logged in, there will be an error as an already account exists with the same service id, so if possible to add a hook just before the merging process that will receive as params (oldId, newId) [accounts ids], so that I can do what I want with the old account (remove, update it).
My solution for another package was working great but the package is no longer updated.

Error handling issue

To allow interpretation on the client, errors on the server should be thrown using "throw new Meteor.Error(...)" rather than "throw new Error(...)".

With errors currently thrown using "throw new Error(...)", the following client-side call will result in a generic internal server error, no matter what the error is:
Meteor.linkWithTwitter( function(error) {
console.log(error)
});

I'd also suggest including some standardized error codes so that developers can write their own error text on the client side.

(Otherwise, this is a great tool - very useful!)

FB Permission issues

Hello, I'm trying to add these specific permissions

[ "public_profile", "user_friends", "email", "user_about_me", "user_actions.books", "user_actions.fitness", "user_actions.music", "user_actions.news", "user_actions.video", "user_birthday", "user_education_history", "user_events", "user_games_activity", "user_hometown", "user_likes", "user_location", "user_managed_groups", "user_photos", "user_posts", "user_relationships", "user_relationship_details", "user_religion_politics", "user_tagged_places", "user_videos", "user_website", "user_work_history", "read_custom_friendlists", "read_insights", "read_audience_network_insights", "read_page_mailboxes", "manage_pages", "publish_pages", "publish_actions", "rsvp_event", "pages_show_list", "pages_manage_cta", "pages_manage_instant_articles", "ads_read", "ads_management", "pages_messaging", "pages_messaging_phone_number" ]

so I tried
Meteor.linkWithFacebook({requestPermissions: Meteor.settings["public"]["FacebookApp"].permission}, function (err,res) { if(!err){ console.log("Facebook Account Connected!"); } else { console.log("Error: ", err); } });

but the only permission that's showing up is the public profile, friend list and email address alone.
Please help. thanks

Additional account being created instead of being linked - any thoughts

I'm attempting to use this package. The README file gave me an indication that it could suit my use case. I've implemented it, but rather than linking the accounts, it is creating additional accounts. Here is what my implementation looks like:

PACKAGES ADDED:
meteor add accounts-facebook
meteor add accounts-twitter
meteor add bozhao:link-accounts
meteor add service-configuration

<!--/client/signIn.html-->
<template name="signInTmpl">
      <button class="btn btn-facebook">Sign in with Facebook</button>  
</template>

<!--/client/linkTweets.html-->
<template name="linkTweetsTmpl">
      <button class="btn btn-twitter">Connect Twitter Account</button>
</template>

//client/linkTweets.js
Template.linkTweetsTmpl.events({
      'click .btn-twitter': function() {
      Meteor.linkWithTwitter(function(err) {
      //Do if conditional ... 
      }) 
  }
})

//server/accounts.js
var createServiceConfiguration;

createServiceConfiguration = function(service, clientId, secret) {
 var config;
 ServiceConfiguration.configurations.remove({
  service: service
  });
 config = {
  generic: {
   service: service,
   clientId: clientId,
   secret: secret
 },
instagram: {
  service: service,
  clientId: clientId,
  scope: 'basic',
  secret: secret,
  loginStyle: "redirect"
},
facebook: {
  service: service,
  appId: clientId,
  secret: secret,
  loginStyle: "redirect"
},
twitter: {
  service: service,
  consumerKey: clientId,
  secret: secret,
  loginStyle: "redirect"
}
};
 switch (service) {
  case 'instagram':
    return ServiceConfiguration.configurations.insert(config.instagram);
  case 'facebook':
    return ServiceConfiguration.configurations.insert(config.facebook);
  case 'twitter':
    return ServiceConfiguration.configurations.insert(config.twitter);
  default:
    return ServiceConfiguration.configurations.insert(config.generic);
  }
};
//DEV KEYS
createServiceConfiguration('instagram', 'api-key', 'api-secret')
createServiceConfiguration('facebook', 'api-key', 'api-secret')
createServiceConfiguration('twitter', 'api-key', 'api-secret')
createServiceConfiguration('google', 'api-key', 'api-secret')

I can successfully sign in with Facebook and when I click on the "Connect Twitter Button" it goes through the authorisation sequence fine, but then creates another account altogether.

Any thoughts on where I am going wrong or have I misunderstood the package?

error when calling Accounts.unlinkService on server side

I20151215-16:21:57.675(8)? Exception while invoking method 'AccountsEx.methods.unlinkService' ReferenceError: Mongo is not defined
I20151215-16:21:57.675(8)? at AccountsServer.Accounts.unlinkService (packages/bozhao_link-accounts/link_accounts_server.js:78:1)
I20151215-16:21:57.675(8)? at [object Object].methods.unlinkService.ValidatedMethod.run (packages/accounts-ex/server/methods.js:467:22)
I20151215-16:21:57.675(8)? at ValidatedMethod.execute (packages/mdg:validated-method/validated-method.js:82:43)
I20151215-16:21:57.675(8)? at [object Object].ValidatedMethod.connection.methods.connection$methods.(anonymous function) (packages/mdg:validated-method/validated-method.js:32:23)
I20151215-16:21:57.675(8)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1698:12)
I20151215-16:21:57.675(8)? at packages/ddp-server/livedata_server.js:708:19
I20151215-16:21:57.675(8)? at [object Object].
.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20151215-16:21:57.675(8)? at packages/ddp-server/livedata_server.js:706:40
I20151215-16:21:57.675(8)? at [object Object].
.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20151215-16:21:57.675(8)? at packages/ddp-server/livedata_server.js:704:46

"duplicate key error index:"

In the event that a user;

  1. uses Facebook to create an account automatically
  2. logs out
  3. creates a new account manually
  4. attempts to link the account in #3 with the same Facebook user used to create an account in #1
  • produces a "Exception while invoking method 'login' MongoError: E11000 duplicate key error index:" error, any suggestions/solutions?

Add server-side callback

It would be useful to be able to do something like

Meteor.afterLinkUser (user) ->
  #push user.services.facebook.email onto user.emails

Rather than what I'm currently doing, which is Meteor.calling an afterLinkUser method from the linkWithFacebook success callback client-side. My current method takes time - a round-trip to the client - and may not happen if something goes wrong on the client end or to the connection between server and client.

Using this with Meteor 1.3?

Seems like it doesn't have access to other libraries so it blows up...

Uncaught ReferenceError: Slack is not defined


Going to try a PR...


Tried to do something like this

import {
  Slack
} from 'meteor/acemtp:accounts-slack';

But import is an unexpected token within a package... damn.

LinkedIn is not defined

Getting the following error when trying to sign in with LinkedIn:

Uncaught ReferenceError: LinkedIn is not defined @linkedin.js:16

packages:

jonperl:[email protected]
jonperl:[email protected]
bozhao:[email protected]

js:

Meteor.linkWithLinkedIn();

Have I missed anything? Would bozhao:link-accounts need an api.use() to get access to the exported vars such as LinkedIn from jonperl:linkedin or make use of Package[]?

To evade this error I did this on the client:

Meteor.linkWithLinkedIn = function (options, callback) {
  ...

  var credentialRequestCompleteCallback = Accounts.oauth.linkCredentialRequestCompleteHandler(callback);
  Package['jonperl:linkedin'].LinkedIn.requestCredential(options, credentialRequestCompleteCallback);
};

Add loginOrLinkWith

Feature Request: If a user is given a number of login service options, and doesn't remember which they used before, and they use a wrong one that has the same email, it would be nice if the accounts were linked.

how can I use accounts-facebook + cordova-fb for mobile purposes?

Hi, I have an app 99folks.com which uses https://atmospherejs.com/particle4dev/cordova-fb to make facebook signin in cordova apps, I'd like to use the link-accounts to provide a screen to user remove or readd your facebook id, but I can't do it because the cordova-fb use as dependencies the accounts-facebook and the link-accounts (for facebook) don't work without accounts-facebook installed.
When I try to install accounts-facebook as duplicated dependency, it throws the error:

Error: Duplicate service: facebook
W20150608-16:49:53.107(-3)? (STDERR)   at Object.Accounts.oauth.registerService (/Users/caio/Documents/workspace/99folks/app-99folks/.meteor/local/build/programs/server/packages/accounts-oauth.js:32:11)

Is there a way to reuse the accounts-facebook from cordova-fb or just ignore the warning and use both accounts-facebook?

Javascript Error on iOS 9

I have experimented javascript errors on devices with iOS 9.3 in Safari and Google Chrome. The error occurs on the first load of the app and let the app fully blank and in a state unusable. Debugging remotely the device I have seen the next error:

SyntaxError: Unexpected token '>'(anonymous function) @ bozhao_link-accounts.js:223

Checking the code the error is due to use arrow functions in the file (the only file where this feature it's used):
https://github.com/yubozhao/meteor-link-accounts/blob/c92acf3c720f442592c4dc68def7e610333156e1/core-services/google.js#L19

The error could be fixed changing this arrow functions by simple anonymous functions or adding the dependency on package ecmascript in the file package.js.

How do I configure, Meteor.linkWithFacebook, to request more data (friends list) from a user's facebook account?

Meteor.linkWithFacebook, will only prompt the user to provide his/her standard/required info and email. I would like to give the use the option to provide my app access to the user's friend's list. I've tried passing arguments to the method, Meteor.linkWithFacebook(['user_friends', 'user_location', 'user_events', 'friends_events', 'friends_location', 'friends_about_me', 'user_status', 'friends_status', 'read_friendlists']), but it still does not seem to request permission to have more than just access to an email.

Are there options that I can pass to, Meteor.linkWithFacebook, which will allow it to access the user for more of its data?

Potential Maintainer

Hi, I'm currently working on a project using numerous oauth integrations and would like to be the maintainer.

Redirect style will create new user

it's fine to link account in popup style, but wechat-mp require to use redirect style, which is a limit of the wechat. could you please support link account with redirect style?

Spotify not linking

in chrome console:
Uncaught Error: Please include xinranxiao:meteor-spotify package [403]

on terminal:
meteor add xinranxiao:meteor-spotify
=> Errors while parsing arguments:
While adding package xinranxiao:meteor-spotify:
error: no such package

However if you change in community-services/spotify.js
the line
if (!Package['xinranxiao:meteor-spotify'] || !Package['xinranxiao:accounts-spotify'] ) {
by
if (!Package['xinranxiao:spotify'] || !Package['xinranxiao:accounts-spotify'] ) {

then it works

Could you push the change or do you prefer a pull request?

If the the same service is already linked to another user, linking dies silently

If the same account (same username from twitter) linked to another user, there is no error in server console or client.

The only evidence I have in kadira from Error: [This social account is already in use by other user]
at packages/bozhao_link-accounts/link_accounts_server.js:56:1

And since the popup window is closed momentarily, user believes account should be linked, but it is not happening

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.