@rpcbase/client 0.38.0 → 0.40.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.
- package/auth/get_uid.js +11 -0
- package/auth/index.js +2 -13
- package/auth/views.js +14 -0
- package/helpers/post.js +1 -3
- package/package.json +1 -1
- package/rpc_post.js +1 -4
package/auth/get_uid.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import {Platform} from "react-native"
|
|
3
|
+
|
|
4
|
+
import {get_uid as _get_uid} from "./index"
|
|
5
|
+
|
|
6
|
+
const get_uid = Platform.OS === "web" ? _get_uid : () => {
|
|
7
|
+
console.warn("native should not call get_uid, use userId from AuthContext")
|
|
8
|
+
return null
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default get_uid
|
package/auth/index.js
CHANGED
|
@@ -2,26 +2,15 @@
|
|
|
2
2
|
import page from "page"
|
|
3
3
|
import debug from "debug"
|
|
4
4
|
|
|
5
|
-
import SignIn from "./SignIn"
|
|
6
|
-
import SignUp from "./SignUp"
|
|
7
|
-
import SignOut from "./SignOut"
|
|
8
|
-
import ForgotPassword from "./ForgotPassword"
|
|
9
|
-
import SetNewPassword from "./SetNewPassword"
|
|
10
|
-
|
|
11
5
|
import post from "../helpers/post"
|
|
12
6
|
|
|
13
|
-
export {
|
|
14
|
-
SignIn,
|
|
15
|
-
SignUp,
|
|
16
|
-
SignOut,
|
|
17
|
-
ForgotPassword,
|
|
18
|
-
SetNewPassword,
|
|
19
|
-
}
|
|
20
7
|
|
|
21
8
|
const UID_STORAGE_KEY = "rb::session-user_id"
|
|
22
9
|
|
|
23
10
|
const log = debug("rb:auth")
|
|
24
11
|
|
|
12
|
+
// TODO: this should be refactored to AuthContext + Provider
|
|
13
|
+
|
|
25
14
|
let __is_authenticated = null
|
|
26
15
|
let __user_id = localStorage.getItem(UID_STORAGE_KEY)
|
|
27
16
|
|
package/auth/views.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import SignIn from "./SignIn"
|
|
3
|
+
import SignUp from "./SignUp"
|
|
4
|
+
import SignOut from "./SignOut"
|
|
5
|
+
import ForgotPassword from "./ForgotPassword"
|
|
6
|
+
import SetNewPassword from "./SetNewPassword"
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
SignIn,
|
|
10
|
+
SignUp,
|
|
11
|
+
SignOut,
|
|
12
|
+
ForgotPassword,
|
|
13
|
+
SetNewPassword,
|
|
14
|
+
}
|
package/helpers/post.js
CHANGED
package/package.json
CHANGED
package/rpc_post.js
CHANGED
|
@@ -7,10 +7,7 @@ import _set from "lodash/set"
|
|
|
7
7
|
import get_txn_id from "@rpcbase/std/get_txn_id"
|
|
8
8
|
import {add_local_txn} from "@rpcbase/realtime-state-client"
|
|
9
9
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const {BASE_URL} = env
|
|
10
|
+
import {BASE_URL} from "env"
|
|
14
11
|
|
|
15
12
|
const client = axios.create({
|
|
16
13
|
withCredentials: true,
|