DeviseAuthenticator
Methods
Overrides: authenticate
of BaseAuthenticator
.
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.
Arguments
-
identification
:String
-
The user's identification
-
password
:String
-
The user's password
Returns
→ Ember.RSVP.Promise
A promise that when it resolves results in the session becoming authenticated
Overrides: invalidate
of BaseAuthenticator
.
Does nothing
Returns
→ Ember.RSVP.Promise
A resolving promise
Makes a request to the Devise server using ember-fetch.
Arguments
-
data
:Object
-
The request data
-
options
:Object
-
request options that are passed to
fetch
Returns
→ Promise
The promise returned by fetch
Overrides: restore
of BaseAuthenticator
.
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.
Arguments
-
data
:Object
-
The data to restore the session from
Returns
→ Ember.RSVP.Promise
A promise that when it resolves results in the session becoming or remaining authenticated
Properties
Default: false
When authentication fails, the rejection callback is provided with the whole Fetch API Response object instead of its responseJSON or responseText.
This is useful for cases when the backend provides additional context not available in the response body.
Deprecated:Use rejectWithResponse instead
Default: false
When authentication fails, the rejection callback is provided with the whole Fetch API Response object instead of its responseJSON or responseText.
This is useful for cases when the backend provides additional context not available in the response body.
Events
sessionDataInvalidated
Inherited from: sessionDataInvalidated
of BaseAuthenticator
.
Triggered when the authentication data is invalidated by the authenticator due to an external or scheduled event. This might happen, e.g., if a token expires or an event is triggered from an external authentication provider that the authenticator uses. The session handles the event and will invalidate itself when it is triggered.
sessionDataUpdated
Inherited from: sessionDataUpdated
of BaseAuthenticator
.
Triggered when the authentication data is updated by the authenticator due to an external or scheduled event. This might happen, e.g., if the authenticator refreshes an expired token or an event is triggered from an external authentication provider that the authenticator uses. The session handles that event, passes the updated data back to the authenticator's restore method and handles the result of that invocation accordingly.
Arguments
-
data
:Object
-
The updated session data