smol projects

basic auth with pocketbase

22.07.2023 1 min read
  1. Authorize with await pb.collection("collection").authWithPassword("username", "password")
  2. This method returns a token, it probably needs to go somewhere
  3. When you need to check whether the token is valid, load it into the PocketBase store with pb.authStore.save(token, null) (why this is .save is beyond me). Check whether the token is valid with pb.authStore.isValid
  4. Call pb.collection("collection").authRefresh() to make sure everything is still good and valid

More here

Built with Astro and Tailwind 🚀