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