@rpcbase/client 0.24.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.
@@ -15,7 +15,6 @@ import "./sign-in.scss"
15
15
 
16
16
  const log = debug("rb:auth:signin")
17
17
 
18
-
19
18
  const SignIn = ({
20
19
  name,
21
20
  logo,
@@ -48,7 +47,6 @@ const SignIn = ({
48
47
  if (res.status === "ok") {
49
48
  log("signed in res: ok", res)
50
49
  log("redirect to:", redirect || onSuccessRedirect)
51
-
52
50
  set_is_signed_in(true)
53
51
  if (redirect) {
54
52
  page(redirect)
@@ -84,7 +82,7 @@ const SignIn = ({
84
82
 
85
83
  <h1 className="h4 mt-3 mb-3 fw-normal">Sign In</h1>
86
84
  <p className="text-start text-muted">
87
- Use your email and password to sign in.<br />Don't have an account?
85
+ Don't have an account?
88
86
  <a href="/signup" className="ms-1">Sign up here</a>
89
87
  </p>
90
88
 
@@ -114,16 +112,6 @@ const SignIn = ({
114
112
  <label htmlFor="input-password">Password</label>
115
113
  </div>
116
114
 
117
- <div className="checkbox mt-3 mb-1 text-start">
118
- <label style={{cursor: "pointer", userSelect: "none"}}>
119
- <input
120
- className="me-1"
121
- type="checkbox"
122
- value="remember-me"
123
- defaultChecked /> Remember me
124
- </label>
125
- </div>
126
-
127
115
  <div className="mt-2 text-start w-100">
128
116
  <a href={`/forgot-password${forgotUrlParam && "#" + forgotUrlParam}`}>Forgot your password?</a>
129
117
  </div>
@@ -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
- page.redirect("/")
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
- <div className="mt-3 d-flex justify-content-center align-items-center">
28
- <div className="me-2"><ActivityIndicator /></div>
29
- <div className="">Signing out, you will be redirected shortly</div>
30
- </div>
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 0"
6
6
  },