@redzone/taunt-logins-ui-react 0.0.21 → 0.0.23

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.
@@ -580,11 +580,14 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
580
580
  magicKey
581
581
  });
582
582
  const [initialised, setInitialised] = react.useState(false);
583
- const [loginDetails, setLoginDetails] = react.useState();
584
583
  const [tauntUser, setTauntUser] = react.useState();
585
584
  const taunt = react.useMemo(()=>new tauntLogins.TauntApi(tauntServiceEndpoint), [
586
585
  tauntServiceEndpoint
587
586
  ]);
587
+ const [loginDetails, setLoginDetails] = react.useState(()=>taunt.accessToken ? {
588
+ accessToken: taunt.accessToken,
589
+ refreshToken: taunt.refreshToken ?? ""
590
+ } : undefined);
588
591
  const [isLoading, setIsLoading] = react.useState(false);
589
592
  const loggedIn = !!tauntUser;
590
593
  const getMe = react.useCallback(async (force = false)=>{
@@ -707,7 +710,9 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
707
710
  ]);
708
711
  react.useEffect(()=>{
709
712
  if (!initialised && !loggedIn) {
710
- void refreshUser().then(()=>{
713
+ void refreshUser().catch(()=>{
714
+ console.error("Error refreshing user on TauntProvider init");
715
+ }).finally(()=>{
711
716
  setInitialised(true);
712
717
  });
713
718
  }
package/dist/es/index.js CHANGED
@@ -580,11 +580,14 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
580
580
  magicKey
581
581
  });
582
582
  const [initialised, setInitialised] = useState(false);
583
- const [loginDetails, setLoginDetails] = useState();
584
583
  const [tauntUser, setTauntUser] = useState();
585
584
  const taunt = useMemo(()=>new TauntApi(tauntServiceEndpoint), [
586
585
  tauntServiceEndpoint
587
586
  ]);
587
+ const [loginDetails, setLoginDetails] = useState(()=>taunt.accessToken ? {
588
+ accessToken: taunt.accessToken,
589
+ refreshToken: taunt.refreshToken ?? ""
590
+ } : undefined);
588
591
  const [isLoading, setIsLoading] = useState(false);
589
592
  const loggedIn = !!tauntUser;
590
593
  const getMe = useCallback(async (force = false)=>{
@@ -707,7 +710,9 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
707
710
  ]);
708
711
  useEffect(()=>{
709
712
  if (!initialised && !loggedIn) {
710
- void refreshUser().then(()=>{
713
+ void refreshUser().catch(()=>{
714
+ console.error("Error refreshing user on TauntProvider init");
715
+ }).finally(()=>{
711
716
  setInitialised(true);
712
717
  });
713
718
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redzone/taunt-logins-ui-react",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "main": "./dist/es/index.js",
6
6
  "module": "./dist/es/index.js",
@@ -59,7 +59,6 @@
59
59
  "globals": "^16.4.0",
60
60
  "prettier": "latest",
61
61
  "prettier-config-custom": "*",
62
- "react": "latest",
63
62
  "typescript": "~5.9.3",
64
63
  "typescript-eslint": "^8.45.0",
65
64
  "vite": "^7.2.1"