@learnpack/learnpack 5.0.340 → 5.0.342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils/api.ts CHANGED
@@ -592,8 +592,17 @@ type TTechnology = {
592
592
 
593
593
  let technologiesCache: TTechnology[] = []
594
594
 
595
+ /** Strip .env comments (e.g. "token # comment") so the token is sent without spaces. */
596
+ function sanitizeToken(token: string | undefined): string {
597
+ if (!token) return ""
598
+ const trimmed = token.trim()
599
+ const beforeComment = trimmed.split(/\s+#/)[0].trim()
600
+ return beforeComment
601
+ }
602
+
595
603
  export const fetchTechnologies = async () => {
596
- const BREATHECODE_PERMANENT_TOKEN = process.env.BREATHECODE_PERMANENT_TOKEN
604
+ const rawToken = process.env.BREATHECODE_PERMANENT_TOKEN
605
+ const BREATHECODE_PERMANENT_TOKEN = sanitizeToken(rawToken)
597
606
  const LANGS = ["en", "es"]
598
607
 
599
608
  if (!BREATHECODE_PERMANENT_TOKEN) {