Getting a 404 on useSession and unable to use Svelte Store

Hi there,

When making a request to: api/auth/use-session I am recieving a 404. This is made to a
Honojs
backend.
Then on the
Svelte
side when I try use the store or value from the useSession method it is saying it is not a
store
.

When making a request to get-session this resolves fine and a user is returned.

Code is something like below:

// Current calls
const useSessionData = authClient.useSession(); // 404
const getSessionData = authClient.getSession(); // 200

// Example usage
<script lang="ts">
  import {authClient} from "$src/auth.client.ts";

  const session = authClient.useSession();
</script>

<main>
  <p>
    {$session.data?.user.email}
  </p>
</main>


`session` is not a store with a `subscribe` method

https://svelte.dev/e/store_invalid_shape
    at Module.store_invalid_shape (C:\Users\luker\dev\utickets\node_modules\svelte\src\internal\shared\errors.js:43:17)
image.png
Was this page helpful?