Commit 9b9f45b
feat: add hardcoded + environment variable code verification
Implemented flexible access code verification with two methods:
Method 1 - Hardcoded List (Option 2):
- VALID_CODES array in ApiKeySettings.tsx
- Includes expiration dates and descriptions
- Perfect for permanent/special access codes
- Example codes: 123-4567-890, 999-8888-777, 555-1234-999
Method 2 - Environment Variables (Option 3):
- VITE_VALID_ACCESS_CODES environment variable
- Comma-separated list of codes
- No expiration dates (unlimited validity)
- Easy to update without code changes
Features:
- Validates against both lists
- Checks expiration dates for hardcoded codes
- Clear validation messages with expiry info
- Added .env.example with configuration examples
Benefits:
- Maximum flexibility for code management
- Can combine both methods simultaneously
- No backend required (fully client-side)
- Easy to manage codes via environment variables
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent aab1490 commit 9b9f45b
2 files changed
+81
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
37 | 65 | | |
38 | 66 | | |
39 | 67 | | |
| |||
94 | 122 | | |
95 | 123 | | |
96 | 124 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
102 | 164 | | |
103 | 165 | | |
104 | 166 | | |
| |||
0 commit comments