fix(auth): add Bearer prefix to PocketBase Authorization header
PocketBase v0.23+ requires 'Bearer <token>' — sending the raw JWT without the prefix results in 403 'Only superusers can perform this action' on all collection record endpoints. Fix applied in three places: - ui/src/lib/server/pocketbase.ts (pbGet, pbPost, pbPatch helpers) - scraper/internal/storage/pocketbase.go (pbClient.do) - scripts/pb-init.sh (wget --header in create_collection)
This commit is contained in:
@@ -44,7 +44,7 @@ create_collection() {
|
||||
BODY="$2"
|
||||
STATUS=$(wget -qSO- \
|
||||
--header="Content-Type: application/json" \
|
||||
--header="Authorization: $TOKEN" \
|
||||
--header="Authorization: Bearer $TOKEN" \
|
||||
--post-data="$BODY" \
|
||||
"$PB_URL/api/collections" 2>&1 | grep "HTTP/" | tail -1 | awk '{print $2}')
|
||||
case "$STATUS" in
|
||||
|
||||
Reference in New Issue
Block a user