Auth plugin gaps for workspace/org configuration
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- api, authentication, backend
Direzione di ricerca
Start by tracing the auth plugin routes and configuration for listOrganizations, client errors, invitation verification, and createTeam; the issue does not name source files or tests. The linked PR in the child project provides context for the workspace settings use case. Done means meeting the listed acceptance criteria, including the optional unified workspace endpoint if that scope is chosen.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
While building out the org/team workspace settings page in a child project, we ran into several gaps in the auth plugin that either require extra round-trips, force fragile client-side workarounds, or create confusing UX. These are functionalities that the plugin contract doesn't expose (or exposes in a way that is hard to use) for a standard "workspace settings" UX.
Gaps
1. listOrganizations does not include the caller's membership role
The listOrganizations route returns org metadata (id, name, slug, logo, metadata, createdAt) but not the caller's role in each org. To know whether the user is an owner/admin/member of the currently active org in a switcher/settings page, we have to make a separate getActiveMember call.
Requested change: Include the caller's membership record (at minimum role, ideally memberId) in each item returned by listOrganizations.
2. Auth client errors lack machine-readable codes
Better Auth server errors are thrown with well-defined error codes (e.g. EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION), but the client error object the UI receives only reliably contains a human-readable message. This forces string matching like:
error.message.toLowerCase().includes("email verification required")
which is brittle across versions/locales.
Requested change: Expose the server error code (and ideally status) on the error object returned to the client, so callers can branch on error.code === "EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION".
3. No runtime/config toggle for requireEmailVerificationOnInvitation
The auth plugin configures Better Auth's organization plugin with requireEmailVerificationOnInvitation: true. This makes listUserInvitations (and accept/reject invitation actions) fail for SIWN and passkey users, because those auth methods create synthetic emails with emailVerified: false. There is no exposed config to relax this for wallet/passkey-only apps.
Requested change: Make requireEmailVerificationOnInvitation configurable via plugin options, or automatically bypass the requirement for sessions whose email is synthetic/verified-by-wallet.
4. No single "active workspace" endpoint
To render a workspace settings page we currently need:
organization.list()for the org listauth.getActiveMember()for the user's roleauth.getContext()/teamWorkspaceQueryOptionsfor teams and active teamorganization.listUserInvitations()for pending invites
Requested change: Consider a single getWorkspace endpoint that returns the user's organizations, active organization, active member role, teams, active team, and pending invitations in one call.
5. createTeam does not add the creator as a team member
When a user calls auth.createTeam, the team is created but the creator is not added as a member. The context's teams list is built from teamMember rows, so the newly created team does not appear for the creator until they explicitly call addTeamMember with their own userId. The UI currently has to work around this by calling createTeam followed immediately by addTeamMember for the current user.
Requested change: createTeam should automatically add the calling user as a member (owner/admin role) of the new team, or expose a separate createTeamAndJoin convenience route.
Acceptance criteria
-
listOrganizationsincludes caller role per org. - Client error objects expose stable
codeandstatusfields. -
requireEmailVerificationOnInvitationis configurable or bypassed for synthetic SIWN/passkey emails. -
createTeamautomatically adds the creator as a team member (or a convenience route is provided). - (Optional) A unified workspace context endpoint reduces the call graph for settings pages.
Context
- Child project:
nearbuilders.org - Affected route:
/settings/workspace - Related PR: https://github.com/NEARBuilders/nearbuilders.org/pull/308
- Lingua principale
- TypeScript
- Stelle
- 5
- Fork
- 3
- Merge medio
- 9h 20m
- PR unite (30g)
- 159
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NEARBuilders/everything-dev
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NEARBuilders/everything-dev#678 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NEARBuilders/everything-dev#628 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NEARBuilders/everything-dev#400 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
NEARBuilders/everything-dev#677 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NEARBuilders/everything-dev#673 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NEARBuilders/everything-dev
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Slaymish/HealthAgent#7 ·
-
area: engine topic: math type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Get-Concord-AI/concord-mcp#310 ·
I maintainer di solito rispondono entro 1 giorno
-
Correct install_claude: 'marketplace add' over a different source is refused, not replaced in placeApertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
nightgauge/nightgauge#2804 ·
I maintainer di solito rispondono entro 1 giorno