@rpcbase/client 0.87.0 → 0.89.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/SignOut/index.js +4 -7
- package/auth/index.js +2 -0
- package/auth/sign_out.js +13 -0
- package/package.json +1 -1
package/auth/SignOut/index.js
CHANGED
|
@@ -5,9 +5,10 @@ import {ActivityIndicator} from "react-native"
|
|
|
5
5
|
import Alert from "react-bootstrap/Alert"
|
|
6
6
|
import page from "page"
|
|
7
7
|
|
|
8
|
+
import {sign_out} from "../sign_out"
|
|
9
|
+
|
|
8
10
|
import post from "../../helpers/post"
|
|
9
11
|
|
|
10
|
-
import {set_is_signed_in, set_uid} from "../index"
|
|
11
12
|
import AccountListItem from "../AccountsList/AccountListItem"
|
|
12
13
|
import Footer from "../Footer"
|
|
13
14
|
|
|
@@ -42,11 +43,7 @@ const SignOut = ({
|
|
|
42
43
|
const signOut = async() => {
|
|
43
44
|
const res = await post("/api/v1/auth/sign_out")
|
|
44
45
|
if (res.status === "ok") {
|
|
45
|
-
|
|
46
|
-
set_is_signed_in(false)
|
|
47
|
-
localStorage.clear()
|
|
48
|
-
|
|
49
|
-
// TODO: clear DB
|
|
46
|
+
sign_out()
|
|
50
47
|
setIsSignedOut(true)
|
|
51
48
|
onSuccess()
|
|
52
49
|
} else {
|
|
@@ -56,8 +53,8 @@ const SignOut = ({
|
|
|
56
53
|
|
|
57
54
|
|
|
58
55
|
const onSubmit = () => {
|
|
56
|
+
console.log("sign out from selected accounts", selectedAccounts)
|
|
59
57
|
signOut()
|
|
60
|
-
console.log("SEL", selectedAccounts)
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
return (
|
package/auth/index.js
CHANGED
package/auth/sign_out.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
|
|
3
|
+
import {set_is_signed_in, set_uid} from "./index"
|
|
4
|
+
|
|
5
|
+
export const sign_out = () => {
|
|
6
|
+
set_uid(null)
|
|
7
|
+
set_is_signed_in(false)
|
|
8
|
+
localStorage.clear()
|
|
9
|
+
|
|
10
|
+
// TODO: clear DB
|
|
11
|
+
// https://stackoverflow.com/a/15861765
|
|
12
|
+
console.log("TODO clear DB")
|
|
13
|
+
}
|