Extends
Members
String
# static identificationAttributeName
The identification attribute name. This will be used in the request and also be expected in the server's response.
Properties:
Name | Type | Description |
---|---|---|
identificationAttributeName |
- Default Value:
- 'email'
String
# static resourceName
The devise resource name. This will be used in the request and also be expected in the server's response.
Properties:
Name | Type | Description |
---|---|---|
resourceName |
- Default Value:
- 'user'
String
# static serverTokenEndpoint
The endpoint on the server that the authentication request is sent to.
Properties:
Name | Type | Description |
---|---|---|
serverTokenEndpoint |
- Default Value:
- '/users/sign_in'
String
# static tokenAttributeName
The token attribute name. This will be used in the request and also be expected in the server's response.
Properties:
Name | Type | Description |
---|---|---|
tokenAttributeName |
- Default Value:
- 'token'
Methods
# static authenticate(identification, password) → {Ember.RSVP.Promise}
Authenticates the session with the specified identification
and
password
; the credentials are POST
ed to the
server.
If the credentials are valid the server will responds with a
token
and
identification.
If the credentials are valid and authentication succeeds, a promise that
resolves with the server's response is returned, otherwise a promise that
rejects with the server error is returned.
Parameters:
Name | Type | Description |
---|---|---|
identification |
String
|
The user's identification |
password |
String
|
The user's password |
A promise that when it resolves results in the session becoming authenticated. If authentication fails, the promise will reject with the server response; however, the authenticator reads that response already so if you need to read it again you need to clone the response object first
Ember.RSVP.Promise
# protected static makeRequest(data, options) → {Promise}
Makes a request to the Devise server using ember-fetch.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
The request data |
options |
Object
|
request options that are passed to |
The promise returned by fetch
Promise
# static restore(data) → {Ember.RSVP.Promise}
Restores the session from a session data object; returns a resolving
promise when there are non-empty
token
and
identification
values in data
and a rejecting promise otherwise.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
The data to restore the session from |
A promise that when it resolves results in the session becoming or remaining authenticated
Ember.RSVP.Promise