ember-auth-strategy-token

token strategy adapter for ember-auth

npm install ember-auth-strategy-token
1 downloads in the last week
16 downloads in the last month

token strategy adapter for ember-auth

Build Status Gem Version NPM version

Token authentication for ember-auth.

Config

App.Auth = Em.Auth.reopen
  strategy: 'token'

  # [string] key for auth token, used in both server requests and
  #   response payloads
  tokenKey: null

  # [string|null] (opt) key for user id, used in both server requests and
  #   response payloads;
  #   null to indicate no user id;
  #   default: null
  tokenIdKey: null

  # [string] (opt) 'param', 'authHeader', or 'customHeader';
  #   default: 'param'
  #   - 'param': send the auth token via a key-value pair in params / data
  #       `(tokenKey)=(auth token)`
  #   - 'authHeader': send the auth token via an Authorization header
  #       `Authorization: (tokenHeaderKey) (auth token)`
  #   - 'customHeader': send the auth token via a custom header
  #       `(tokenHeaderKey): (auth token)`
  tokenLocation: 'param'

  # [string|null] (opt) used in complement when `tokenLocation` is
  #   'authHeader' or 'customHeader' - see doc for `tokenLocation`;
  #   default: null
  tokenHeaderKey: null

Usage

@auth.authToken # access the auth token
npm loves you