Skip to content

feat(auth): allow anonymous download for global skills#442

Open
myml wants to merge 1 commit into
iflytek:mainfrom
myml:fix-download
Open

feat(auth): allow anonymous download for global skills#442
myml wants to merge 1 commit into
iflytek:mainfrom
myml:fix-download

Conversation

@myml
Copy link
Copy Markdown
Contributor

@myml myml commented May 15, 2026

Update handleDownload to bypass the authentication requirement when the
namespace is 'global'. This enables unauthenticated users to download
public global skills, consistent with the publicly accessible route.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the handleDownload function in skill-detail.tsx to allow users to download content without being logged in if the namespace is set to 'global'. The review feedback identifies a need for stricter type checking by using the !== operator and suggests improving code readability by adding spaces around operators, aligning with standard TypeScript practices.

Comment thread web/src/pages/skill-detail.tsx Outdated

const handleDownload = async () => {
if (!user) {
if (namespace!='global' && !user) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The comparison uses the non-strict inequality operator != and lacks spaces, which is inconsistent with the rest of the file and violates standard TypeScript idioms. Use the strict inequality operator !== and add spaces around the operator for better readability and consistency.

Suggested change
if (namespace!='global' && !user) {
if (namespace !== 'global' && !user) {
References
  1. Always use === and !== instead of == and != to avoid type coercion issues and maintain consistency, as recommended by the Google TypeScript Style Guide. (link)

Update handleDownload to bypass the authentication requirement when the
namespace is 'global'. This enables unauthenticated users to download
public global skills, consistent with the publicly accessible route.
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