Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .claude/skills/integrate/auth-nextauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async def authenticate(authorization: str | None) -> Auth.types.MinimalUserDict:

return {
"identity": payload["sub"],
"role": payload.get("role"),
"email": payload.get("email"),
"display_name": payload.get("name"),
"is_authenticated": True,
Expand All @@ -109,8 +110,12 @@ async def authenticate(authorization: str | None) -> Auth.types.MinimalUserDict:
raise AUTH_EXCEPTION


@auth.on
async def add_owner(ctx: Auth.types.AuthContext, value: dict) -> dict:
@auth.on.threads.create
@auth.on.threads.read
@auth.on.threads.update
@auth.on.threads.delete
@auth.on.threads.search
async def filter_by_owner(ctx: Auth.types.AuthContext, value: dict) -> dict:
"""Isolate threads per user."""
filters = {"owner": ctx.user.identity}
metadata = value.setdefault("metadata", {})
Expand Down
Loading