@rpcbase/client 0.93.0 → 0.94.0

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.
@@ -35,7 +35,7 @@ const SignUp = ({
35
35
  set_tenant_id(user_id.slice(0, 8))
36
36
  set_is_signed_in(true)
37
37
 
38
- // we must now reconnect on the websocket as we now have a new cookie
38
+ // we must now reconnect on the websocket as we have a new cookie
39
39
  rts_reconnect()
40
40
  onSuccess()
41
41
  page(onSuccessRedirect)
package/auth/index.js CHANGED
@@ -107,10 +107,17 @@ export const session_restrict = (ctx, next) => {
107
107
 
108
108
 
109
109
  export const get_uid = () => __user_id
110
- export const set_uid = (val) => __user_id = val
110
+ export const set_uid = (val) => {
111
+ __user_id = val
112
+ const tenant_id_prefix = val.slice(0, 8)
113
+ localStorage.setItem(uid_storage_key(tenant_id_prefix), val)
114
+ }
111
115
 
112
116
  export const get_tenant_id = () => __tenant_id
113
- export const set_tenant_id = (val) => __tenant_id = val
117
+ export const set_tenant_id = (val) => {
118
+ __tenant_id = val
119
+ localStorage.setItem(LAST_TENANT_KEY, val)
120
+ }
114
121
 
115
122
  export const set_is_signed_in = (val) => __is_authenticated = val
116
123
 
package/auth/sign_out.js CHANGED
@@ -1,9 +1,10 @@
1
1
  /* @flow */
2
2
 
3
- import {set_is_signed_in, set_uid} from "./index"
3
+ import {set_is_signed_in, set_uid, set_tenant_id} from "./index"
4
4
 
5
5
  export const sign_out = () => {
6
6
  set_uid(null)
7
+ set_tenant_id(null)
7
8
  set_is_signed_in(false)
8
9
  localStorage.clear()
9
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.93.0",
3
+ "version": "0.94.0",
4
4
  "scripts": {
5
5
  "build-firebase": "webpack -c firebase/webpack.config.js",
6
6
  "build": "yarn build-firebase",
package/rts/index.js CHANGED
@@ -177,7 +177,6 @@ export const register_query = (model_name, query, _options, _callback) => {
177
177
 
178
178
  log("register_query", {model_name, query, options, callback})
179
179
 
180
-
181
180
  if (!_socket) {
182
181
  log("register_query: trying to use null socket", {model_name, query})
183
182
  return