-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add optional per-user drawing limit with bypass list via environment variables #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+143
−10
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4f374a2
Initial plan
Copilot 422d876
Add environment variable to limit drawings per user
Copilot 3b53b68
Address code review feedback - use PostgrestError and validate positi…
Copilot c2df17e
Add VITE_UNLIMITED_USERS bypass list for drawing limit
Copilot b599b3b
Optimize bypass list parsing with caching and improve count query
Copilot 415d627
Merge main branch - resolve conflicts and integrate default folder fe…
Copilot a95a97e
Merge origin/main - keep drawing limit with default folder features
Copilot 059417c
Fix drawing limit count query to handle NULL is_deleted values
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Supabase Configuration | ||
| VITE_SUPABASE_URL=your_supabase_url | ||
| VITE_SUPABASE_ANON_KEY=your_supabase_anon_key | ||
|
|
||
| # Sentry Configuration (Optional) | ||
| VITE_SENTRY_DSN=your_sentry_dsn | ||
|
|
||
| # Drawing Limit (Optional) | ||
| # Set the maximum number of drawings a user can create | ||
| # If not set, users can create unlimited drawings | ||
| # Example: VITE_MAX_DRAWINGS_PER_USER=10 | ||
| # VITE_MAX_DRAWINGS_PER_USER= | ||
|
|
||
| # Unlimited Users (Optional) | ||
| # Comma-separated list of user emails that bypass the drawing limit | ||
| # These users can create unlimited drawings even if VITE_MAX_DRAWINGS_PER_USER is set | ||
| # Example: VITE_UNLIMITED_USERS=admin@example.com,manager@example.com | ||
| # VITE_UNLIMITED_USERS= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The code incorrectly accesses
profile.user?.idto get the user ID. Theprofilevariable is the user object itself, soprofile.useris undefined, causing the check to fail.Severity: HIGH
Suggested Fix
Correct the property access for the user ID. Instead of using
profile.user?.id, useprofile?.idto correctly reference the ID on the user object. This will ensure the database query to count drawings uses the correct user ID.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.