diff --git a/frontend/src/components/protected-route/index.tsx b/frontend/src/components/protected-route/index.tsx index ba470ca..c8dde83 100644 --- a/frontend/src/components/protected-route/index.tsx +++ b/frontend/src/components/protected-route/index.tsx @@ -1,7 +1,7 @@ import { Navigate } from "@solidjs/router"; import { platform } from "@tauri-apps/plugin-os"; import { jwtDecode } from "jwt-decode"; -import { Component, ParentProps, Show } from "solid-js"; +import { Component, createSignal, ParentProps, Show } from "solid-js"; import { save_token } from "tauri-plugin-ios-shared-token-api"; import { InferOutput, literal, number, object, parse, pipe, string, transform } from "valibot"; @@ -34,6 +34,7 @@ export const getTokenProperties = (token: string): InferOutput = (props) => { const isValid = isTokenValid(); + const [error, setError] = createSignal(); if (isValid) { const token = localStorage.getItem("refresh"); @@ -47,12 +48,15 @@ export const ProtectedRoute: Component = (props) => { // This involves App Groups. save_token(token) .then(() => console.log("Saved token!!!")) - .catch((e) => console.error(e)); + .catch((e) => setError("Couldnt save token: " + e)); } } return ( }> + + {e =>

{e()}

} +
{props.children}
);