项目作者: LoriKarikari

项目描述 :
Mixer account login for Meteor
高级语言: JavaScript
项目地址: git://github.com/LoriKarikari/meteor-accounts-mixer.git
创建时间: 2019-11-01T16:03:15Z
项目社区:https://github.com/LoriKarikari/meteor-accounts-mixer

开源协议:MIT License

下载


Meteor Acccounts Mixer

Mixer account login for Meteor

Install

cd <your-meteor-project>

meteor add service-configuration

meteor add lorikarikari:accounts-mixer

Setup and Usage

  1. Register your app at the Mixer Developer Lab website - https://mixer.com/lab/oauth

  2. Fill out the given form, for e.g. localhost :

    • website: http://localhost:3000
    • hosts: localhost
  3. After registration add your client id and client secret to settings.json.

  4. Create accounts.js in the server folder and add the following code:

  1. ServiceConfiguration.configurations.remove({
  2. service: "mixer"
  3. });
  4. ServiceConfiguration.configurations.insert({
  5. service: "mixer",
  6. clientId: "Meteor.settings.private.<your-client-id>",
  7. redirectUri: Meteor.absoluteUrl() + '_oauth/mixer?close',
  8. secret: "Meteor.settings.private.<your-client-secret>",
  9. loginStyle: "redirect"
  10. });
  1. Add this function to the click event of your button.
  1. Meteor.loginWithMixer(function (err) {
  2. if (err) console.log('login failed: ' + err)
  3. });
  1. If you want specific permissions, add the scope as an option.
    You can find a list of all scopes at https://dev.mixer.com/reference/oauth/scopes.
  1. const scope = ["user:details:self", "user:update:self", "user:analytics:self"];
  2. Meteor.loginWithMixer({requestPermissions: scope}, function (err) {
  3. if (err) console.log("login failed: " + err)
  4. });