diff --git a/deployment/cloud/admin.mjs b/deployment/cloud/admin.mjs index 137970c6d..447c151fe 100644 --- a/deployment/cloud/admin.mjs +++ b/deployment/cloud/admin.mjs @@ -4,6 +4,7 @@ // /pb/* PocketBase DEV, signed-in; its /_/ dashboard only for OIDC_ADMIN_GROUPS. With PB_OIDC_CLIENT_SECRET, // its /api/ is PUBLIC (PocketBase signs people in itself), except _superusers and _system collections // /admin/build POST: start a build (OIDC_ADMIN_GROUPS only); /admin/status GET +// /admin/pb-signin-check a page that signs in to the team PocketBase and shows who it thinks you are // Groups come from oauth2-proxy's X-Forwarded-Groups, which it sets on signed-in routes only. import { spawn } from 'node:child_process' import { existsSync, readFileSync, statSync } from 'node:fs' @@ -48,6 +49,8 @@ Bun.serve({ if (p.startsWith('/pb/api/collections/_') && !isAdmin(req)) return text('for admins only', 403) return proxy(req, url, '/pb/', 8090) } + // A one-click check of the team PocketBase sign-in (behind the site sign-in like every /admin/ path). + if (p === '/admin/pb-signin-check') return new Response(Bun.file('/app/repo/deployment/cloud/pb-signin-check.html'), { headers: { 'content-type': 'text/html; charset=utf-8', 'cache-control': 'no-store' } }) if (p === '/admin/status') return Response.json(last) if (p === '/admin/build') { if (req.method !== 'POST') return text('POST only', 405) diff --git a/deployment/cloud/pb-signin-check.html b/deployment/cloud/pb-signin-check.html new file mode 100644 index 000000000..68a8a90c9 --- /dev/null +++ b/deployment/cloud/pb-signin-check.html @@ -0,0 +1,52 @@ + + + +Team PocketBase sign-in check + +

Team PocketBase sign-in check

+

Signs you in to the team PocketBase (/pb) through the team account, and shows who it thinks you are. Nothing is stored in this page.

+ +
Not tried yet.
+