Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 'redirect' login style #59

Open
techbos opened this issue Nov 13, 2016 · 2 comments
Open

Support for 'redirect' login style #59

techbos opened this issue Nov 13, 2016 · 2 comments

Comments

@techbos
Copy link

techbos commented Nov 13, 2016

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);
  },
@StorytellerCZ
Copy link
Member

Duplicate of #58

@StorytellerCZ
Copy link
Member

@techbos As for the code it looks as any other, so I don't think the problem is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants