@rpcbase/client 0.25.0 → 0.26.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 +14 -5
- package/package.json +1 -1
package/auth/SignOut/index.js
CHANGED
|
@@ -8,13 +8,15 @@ import {set_is_signed_in} from "../index"
|
|
|
8
8
|
|
|
9
9
|
const SignOut = () => {
|
|
10
10
|
|
|
11
|
+
const [isSignedOut, setIsSignedOut] = useState(false)
|
|
12
|
+
|
|
11
13
|
useEffect(() => {
|
|
12
14
|
setTimeout(async() => {
|
|
13
15
|
const res = await post("/api/v1/auth/sign_out")
|
|
14
16
|
if (res.status === "ok") {
|
|
15
17
|
set_is_signed_in(false)
|
|
16
18
|
localStorage.clear()
|
|
17
|
-
|
|
19
|
+
setIsSignedOut(true)
|
|
18
20
|
} else {
|
|
19
21
|
throw new Error("unable to sign out")
|
|
20
22
|
}
|
|
@@ -24,10 +26,17 @@ const SignOut = () => {
|
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<div id="sign-out-wrapper">
|
|
27
|
-
|
|
28
|
-
<div className="
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
{!isSignedOut && (
|
|
30
|
+
<div className="mt-3 d-flex justify-content-center align-items-center">
|
|
31
|
+
<div className="me-2"><ActivityIndicator /></div>
|
|
32
|
+
<div className="">Signing out, you will be redirected shortly</div>
|
|
33
|
+
</div>
|
|
34
|
+
)}
|
|
35
|
+
{isSignedOut && (
|
|
36
|
+
<div className="mt-3 d-flex justify-content-center align-items-center">
|
|
37
|
+
<div className="">Signed out</div>
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
31
40
|
</div>
|
|
32
41
|
)
|
|
33
42
|
}
|