@rpcbase/client 0.22.0 → 0.24.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.
@@ -1,6 +1,8 @@
1
1
  /* @flow */
2
2
  import {useState} from "react"
3
+ import page from "page"
3
4
 
5
+ import {set_is_signed_in} from "../index"
4
6
  import post from "../../helpers/post"
5
7
  import Footer from "../Footer"
6
8
 
@@ -24,7 +26,8 @@ const SignUp = ({
24
26
  }
25
27
  const res = await post("/api/v1/auth/sign_up", {email, password})
26
28
  if (res.status === "ok") {
27
- window.location = onSuccessRedirect
29
+ set_is_signed_in(true)
30
+ page(onSuccessRedirect)
28
31
  } else if (res.status === "error") {
29
32
  setError(res.message)
30
33
  }
package/auth/index.js CHANGED
@@ -72,7 +72,8 @@ export const session_restrict = (ctx, next) => {
72
72
  } else {
73
73
  log("AUTH", JSON.stringify(__is_authenticated))
74
74
  log("NOT AUTHENTICATED, REDIRECT HERE")
75
- next()
75
+ redirect_sign_in(ctx)
76
+ // next()
76
77
  }
77
78
  }
78
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 0"
6
6
  },