diff --git a/lib/notifications/submission.js b/lib/notifications/submission.js index 3659a2f..5615a1a 100644 --- a/lib/notifications/submission.js +++ b/lib/notifications/submission.js @@ -1,6 +1,7 @@ 'use babel' import path from 'path' +import token from '../token' import fetch from '../fetch' import {learnCo} from '../config' @@ -12,7 +13,10 @@ function getLessonTitle(lessonID) { if (title != null) { return Promise.resolve(title) } - return fetch(`${learnCo}/api/v1/lessons/${lessonID}`).then(({title}) => { + var lessonEndpoint = `${learnCo}/api/v1/lessons/${lessonID}`; + var headers = new Headers({'Authorization': `Bearer ${token.get()}`}); + + return fetch(lessonEndpoint, {headers}).then(({title}) => { cachedLessonTitles[lessonID] = title || 'Learn IDE'; return title; });