Giter VIP home page Giter VIP logo

pocketbase-sveltekit-auth's People

Contributors

dependabot[bot] avatar jianyuan avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pocketbase-sveltekit-auth's Issues

currentUser is null after registering

Hey, thanks for putting together this repo and the YouTube video.

I'm able to successfully register a user but for some reason $currentUser is null and when I look at local storage the pocketbase_auth is {token: '', model: null}

When I console log pb.authStore.model in hooks.client.js, it's null

pb.authStore.onChange(() => {
  console.log('pb.authStore CHANGE', pb.authStore.model);
  currentUser.set(pb.authStore.model)
  document.cookie = pb.authStore.exportToCookie({ httpOnly: false })
})

Any ideas?

`hooks.server.ts` should use a new PocketBase instance for each request

This template was shared with me in pocketbase/pocketbase#2949, but I noticed that it loads a single global PocketBase instance for each request in hooks.server.ts.

As mentioned in the above discussion, unless I'm misunderstanding the structure of the application, event.locals.pb = pb doesn't create a new instance. It uses the same object instantiated in $lib/pocketbase.ts.

You need to create a new PocketBase instance for each server-side request because requests from different users could write over the same pb.authStore object.

For hooks.client.ts is OK to have a single global PocketBase instance because the pb.authStore in this case is kept in the user's browser and it is not shared with the other users.

My recommendation would be to create and export a function from $lib/pocketbase.ts that will create a new PocketBase instance every time when it is called in hooks.server.ts.

Enhance forms with loading and error states

I think it would be great to have loading indicators in the forms will the request is processed and also have the form fields disabled in the meantime.

Also, when there is an error, it would be great when the server actions would return the error details for frontend notices.

I totally understand, when you don't want to have all of this implemented here, to keep things simple and related to pocketbase only.

However, when you also think this would be nice to have (should not be that much boilerplate), then I could open a PR for those features.

What do you think? @jianyuan

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update dependency vite to v4.5.2 [security]
  • chore(deps): update dependency @sveltejs/adapter-auto to v2.1.1
  • chore(deps): update dependency @tailwindcss/forms to v0.5.7
  • chore(deps): update dependency autoprefixer to v10.4.17
  • chore(deps): update dependency postcss to v8.4.34
  • chore(deps): update dependency postcss-load-config to v4.0.2
  • chore(deps): update dependency svelte to v4.2.10
  • chore(deps): update dependency @sveltejs/kit to v1.30.3
  • chore(deps): update dependency eslint to v8.56.0
  • chore(deps): update dependency eslint-config-prettier to v9.1.0
  • chore(deps): update dependency prettier to v3.2.5
  • chore(deps): update dependency prettier-plugin-svelte to v3.1.2
  • chore(deps): update dependency svelte-check to v3.6.3
  • chore(deps): update dependency svelte-preprocess to v5.1.3
  • chore(deps): update dependency tailwindcss to v3.4.1
  • chore(deps): update dependency typescript to v5.3.3
  • chore(deps): update typescript-eslint monorepo to v6.21.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • pocketbase ^0.18.0
  • @sveltejs/adapter-auto ^2.1.0
  • @sveltejs/kit ^1.25.1
  • @tailwindcss/forms ^0.5.6
  • @tailwindcss/typography ^0.5.10
  • @typescript-eslint/eslint-plugin ^6.7.4
  • @typescript-eslint/parser ^6.7.4
  • autoprefixer ^10.4.16
  • daisyui ^3.8.3
  • eslint ^8.50.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-svelte3 ^4.0.0
  • postcss ^8.4.31
  • postcss-load-config ^4.0.1
  • prettier ^3.0.3
  • prettier-plugin-svelte ^3.0.3
  • svelte ^4.2.1
  • svelte-check ^3.5.2
  • svelte-preprocess ^5.0.4
  • tailwindcss ^3.3.3
  • tslib ^2.6.2
  • typescript ^5.2.2
  • vite ^4.4.9

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.