Return empty auth header when we don't have a user.

このコミットが含まれているのは:
Roger Braun 2016-11-06 20:10:45 +01:00
コミット 3bb2e91dbf
1個のファイルの変更7行の追加1行の削除

ファイルの表示

@ -14,7 +14,13 @@ const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
// import { param, ajax } from 'jquery';
// import { merge } from 'lodash';
const authHeaders = (user) => ({ 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` })
const authHeaders = (user) => {
if (user) {
return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` }
} else {
return { }
}
}
const fetchTimeline = ({timeline, credentials, since = false, until = false}) => {
const timelineUrls = {