@rpcbase/client 0.25.0 → 0.27.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/SignIn/index.js +28 -21
- package/auth/SignIn/sign-in.scss +4 -0
- package/auth/SignOut/index.js +14 -5
- package/package.json +1 -1
package/auth/SignIn/index.js
CHANGED
|
@@ -15,6 +15,9 @@ import "./sign-in.scss"
|
|
|
15
15
|
|
|
16
16
|
const log = debug("rb:auth:signin")
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
const SIGNIN_WITH_GITHUB = false
|
|
20
|
+
|
|
18
21
|
const SignIn = ({
|
|
19
22
|
name,
|
|
20
23
|
logo,
|
|
@@ -120,27 +123,31 @@ const SignIn = ({
|
|
|
120
123
|
|
|
121
124
|
</form>
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
{SIGNIN_WITH_GITHUB && (
|
|
127
|
+
<>
|
|
128
|
+
<hr />
|
|
129
|
+
<p className="text-muted">OR</p>
|
|
130
|
+
|
|
131
|
+
<a href="/signup"
|
|
132
|
+
className="sign-in-github-btn p-2 btn-lg w-100"
|
|
133
|
+
style={{}}>
|
|
134
|
+
<div style={{}} className="me-2">
|
|
135
|
+
<svg height="28px" width="28px" viewBox="0 0 16 16" style={{fill: "currentColor"}}>
|
|
136
|
+
<path fillRule={"evenodd"} d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38
|
|
137
|
+
0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01
|
|
138
|
+
1.08.58 1.23.82.72 1.21 1.87.87
|
|
139
|
+
2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12
|
|
140
|
+
0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08
|
|
141
|
+
2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0
|
|
142
|
+
.21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
|
|
143
|
+
</svg>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="">
|
|
146
|
+
Sign in with GitHub
|
|
147
|
+
</div>
|
|
148
|
+
</a>
|
|
149
|
+
</>
|
|
150
|
+
)}
|
|
144
151
|
|
|
145
152
|
</div>
|
|
146
153
|
</div>
|
package/auth/SignIn/sign-in.scss
CHANGED
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
|
}
|