Skip to content

Support for 'redirect' login style #59

@techbos

Description

@techbos

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);
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions