Skip to content

Conversation

pan93412
Copy link
Member

@pan93412 pan93412 commented Oct 4, 2025

Before (always allowed):

CleanShot 2025-10-05 at 03 18 32@2x

After (only authorized allowed):

CleanShot 2025-10-05 at 03 19 34@2x CleanShot 2025-10-05 at 03 23 35@2x

@pan93412 pan93412 self-assigned this Oct 4, 2025
Copy link

linear bot commented Oct 4, 2025

Copy link
Contributor

vercel bot commented Oct 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dbplay-app Ready Ready Preview Comment Oct 4, 2025 7:23pm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements scope-based authorization for AI chat functionality by enhancing the authentication system to check for specific user permissions. Users must now have either "*" or "ai" scope to access AI chat features.

  • Enhanced checkAuthorizedStatus function to accept and validate required scopes
  • Added scope checking logic that validates user permissions against token introspection results
  • Applied AI-specific authorization to the chat API endpoint

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/auth.rsc.ts Enhanced authorization function to support scope-based permissions checking
app/api/chat/route.ts Applied AI scope requirement to chat endpoint authorization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan93412 pan93412 merged commit 1650072 into main Oct 4, 2025
4 checks passed
@pan93412 pan93412 deleted the pan93412/dbp-88-任意使用者都能使用-ai branch October 4, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant