@knowlearning/agents 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,12 +9,16 @@ function login() {
9
9
  }
10
10
 
11
11
  function logout() {
12
- // TODO: hit logout url to refresh cookie
12
+ // Doing this will establish a new anonymous session
13
+ localStorage.setItem('token', Math.random().toString(36).substring(2))
13
14
  window.location.reload()
14
15
  }
15
16
 
16
17
  async function getToken() {
17
- return localStorage.getItem('token')
18
+ // Browser tokens are 1 time use
19
+ const token = localStorage.getItem('token')
20
+ localStorage.removeItem('token')
21
+ return token
18
22
  }
19
23
 
20
24
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",