We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 568389e commit 9594e92Copy full SHA for 9594e92
src/lib/api/oss-insight-client.ts
@@ -14,8 +14,10 @@ class OSSInsightClient {
14
private githubBaseUrl = 'https://api.github.com'
15
private githubToken = process.env.NEXT_PUBLIC_GITHUB_TOKEN || ''
16
17
- // Allow setting user token dynamically
18
- setUserToken(token: string) {
+ setUserToken(token: string) {
+ if (!token || typeof token !== 'string' || token.trim().length === 0) {
19
+ throw new Error('Invalid GitHub token: must be a non-empty string')
20
+ }
21
this.githubToken = token
22
}
23
0 commit comments