ember-cli-simple-auth-kinvey

Kinvey integration for Ember Simple Auth

Usage no npm install needed!

<script type="module">
  import emberCliSimpleAuthKinvey from 'https://cdn.skypack.dev/ember-cli-simple-auth-kinvey';
</script>

README

ember-cli-simple-auth-kinvey

Ember Simple Auth integration for Kinvey

Installation

ember install:addon ember-cli-simple-auth-kinvey

Configuration

// config/environment.js
module.exports = function(environment) {
  var ENV = {
    // ...
    'simple-auth': {
      authorizer: 'simple-auth-authorizer:kinvey',
      crossOriginWhitelist: ['https://baas.kinvey.com']
    },

    'simple-auth-kinvey': {
      appKey: 'appKey',
      appSecret: 'appSecret',
    }
    // ...
  },
  // ...
};

Usage

Login

//...
this.get('session').authenticate('simple-auth-authenticator:kinvey', {
  username: username,
  password: password
});

Signup

//...
this.get('session').authenticate('simple-auth-authenticator:kinvey', {
  username: username,
  password: password,
  _isSignup: true
});

Logout

//...
this.get('session').invalidate();