Skip to content

Commit a7213f1

Browse files
authored
Port #277 to 3-dev (#310)
1 parent 1916340 commit a7213f1

File tree

32 files changed

+330
-246
lines changed

32 files changed

+330
-246
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
code: true
33
type: branch
4-
title: Accessors
4+
title: accessors
55
---
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
code: true
33
type: branch
4-
title: Constructors
4+
title: constructors
55
---
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
code: true
33
type: branch
4-
title: Errors
4+
title: errors
55
---
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
code: true
33
type: branch
4-
title: Log
4+
title: log
55
---

src/sdk/js/6/controllers/auth/login/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ description: Authenticate a user
99

1010
Authenticates a user.
1111

12-
If this action is successful, all further requests emitted by this SDK instance will be in the name of the authenticated user, until either the authenticated token expires, the [logout](/sdk/js/6/controllers/auth/logout/) action is called, or the [jwt](/sdk/js/6/core-classes/kuzzle/constructor/) property is manually unset.
12+
If this action is successful, then the [jwt](/sdk/js/6/core-classes/kuzzle/properties) property of this class instance is set to the new authentication token.
13+
14+
All further requests emitted by this SDK instance will be on behalf of the authenticated user, until either the authenticated token expires, the [logout](/sdk/js/6/controllers/auth/logout) action is called, or the `jwt` property is manually set to another value.
1315

1416
## Arguments
1517

src/sdk/js/6/controllers/auth/logout/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ description: Revokes the user's token & unsubscribe them from registered rooms.
77

88
# logout
99

10-
Revokes the user's authentication token.
10+
Revokes the current authentication token.
1111

1212
If there were any, real-time subscriptions are cancelled.
1313

14+
If this action is successful, then the [jwt](/sdk/js/6/core-classes/kuzzle/properties) property of this class instance is unset.
15+
1416
<br/>
1517

1618
```javascript

src/sdk/js/6/controllers/auth/refresh-token/index.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,46 @@ title: refreshToken
55
description: Refresh an authentication token
66
---
77

8-
# refreshToken
8+
# refreshToken
99

1010
<SinceBadge version="6.1.0" />
1111

12-
Refreshes a valid, non-expired authentication token.
12+
Refreshes a valid, non-expired authentication token.
1313

14-
If this action is successful, all further requests emitted by this SDK instance will use the refreshed authentication token.
14+
If this action is successful, then the [jwt](/sdk/js/6/core-classes/kuzzle/properties) property of this class instance is set to the new authentication token.
1515

16-
## Arguments
16+
All further requests emitted by this SDK instance will be on behalf of the authenticated user, until either the authenticated token expires, the [logout](/core/sdk/js/6/auth/logout) action is called, or the `jwt` property is manually set to another value.
1717

18-
```javascript
18+
19+
## Arguments
20+
21+
```javascript
1922
refreshToken ([options])
2023
```
2124

22-
<br/>
25+
<br/>
2326

24-
| Arguments | Type | Description |
27+
| Arguments | Type | Description |
2528
|--------------|---------|-------------|
2629
| `options` | <pre>object</pre> | Query options |
2730

2831

29-
### options
32+
### options
3033

31-
Additional query options
34+
Additional query options
3235

3336
| Property | Type<br/>(default) | Description |
3437
| -------------- | --------- | ------------- |
3538
| `expiresIn` | <pre>string</pre> | Expiration time in [ms library](https://www.npmjs.com/package/ms) format. (e.g. `2h`) |
3639
| `queuable` | <pre>boolean</pre><br/>(`true`)| If true, queues the request during downtime, until connected to Kuzzle again |
3740

38-
### expiresIn
41+
### expiresIn
3942

40-
The default value for the `expiresIn` option is defined at server level, in Kuzzle's [configuration file](/core/1/guide/guides/essentials/configuration/).
43+
The default value for the `expiresIn` option is defined at server level, in Kuzzle's [configuration file](/core/1/guide/guides/essentials/configuration/).
4144

42-
## Resolves
45+
## Resolves
4346

44-
The `refreshToken` action resolves to a token object with the following properties:
47+
The `refreshToken` action resolves to a token object with the following properties:
4548

4649
| Property | Type | Description |
4750
|--------------|---------|-------------|
@@ -50,6 +53,6 @@ refreshToken ([options])
5053
| `jwt` | <pre>string</pre> | Authentication token |
5154
| `ttl` | <pre>number</pre> | Time to live of the authentication token, in milliseconds |
5255

53-
## Usage
56+
## Usage
5457

55-
<<< ./snippets/refreshToken.js
58+
<<< ./snippets/refreshToken

src/sdk/js/6/controllers/auth/refresh-token/snippets/refreshToken.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ try {
1919
console.log(await kuzzle.auth.refreshToken());
2020
} catch (error) {
2121
console.error(error.message);
22-
}
22+
}

src/sdk/js/6/controllers/auth/refresh-token/snippets/refreshToken.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ expected:
1212
- ^\s*expiresAt: \d+
1313
- ^\s*ttl: \d+ }
1414
sdk: js
15-
version: 6
15+
version: 6
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
code: true
2+
code: false
33
type: page
44
title: Introduction
55
description: KuzzleError object
@@ -10,14 +10,4 @@ order: 0
1010

1111
Inherits from the standard `Error` class.
1212

13-
The KuzzleError class represents an [error response from Kuzzle API](/core/1/api/essentials/errors/).
14-
15-
## Properties
16-
17-
Available properties.
18-
19-
| Property name | Type | Description |
20-
| ------------- | ----------------- | ------------------------------------------- |
21-
| `message` | <pre>string</pre> | Error message |
22-
| `status` | <pre>number</pre> | Error status code |
23-
| `stack` | <pre>string</pre> | Error stacktrace (only in development mode) |
13+
The KuzzleError class represents an [error response from Kuzzle API](/core/1/api/essentials/errors/).

0 commit comments

Comments
 (0)