Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 3.23 KB

File metadata and controls

59 lines (38 loc) · 3.23 KB
code type title description
true
page
refreshToken
Refresh an authentication token

refreshToken

Refreshes a valid, non-expired authentication token.

If this action is successful, then the jwt property of this class instance is set to the new authentication token.

All further requests emitted by this SDK instance will be on behalf of the authenticated user, until either the authenticated token expires, the logout action is called, or the jwt property is manually set to another value.

Arguments

refreshToken ([options])

Arguments Type Description
options
object
Query options

options

Additional query options

Property Type
(default)
Description
expiresIn
string
Expiration time in ms library format. (e.g. 2h)
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again
timeout
number

(-1)
Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely

expiresIn

The default value for the expiresIn option is defined at server level, in Kuzzle's configuration file.

Resolves

The refreshToken action resolves to a token object with the following properties:

Property Type Description
_id
string
User unique identifier (kuid)
expiresAt
number
Expiration timestamp in Epoch-millis format (UTC)
jwt
string
Authentication token (returned only if the option cookieAuth is not enabled in the SDK, otherwise stored in an http cookie)
ttl
number
Time to live of the authentication token, in milliseconds

Usage

<<< ./snippets/refreshToken.js