Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into dm-tab

This commit is contained in:
Roger Braun 2018-11-13 20:21:04 +01:00
commit 7f13cbc493
19 changed files with 1412 additions and 244 deletions

View file

@ -53,16 +53,6 @@ let fetch = (url, options) => {
return oldfetch(fullUrl, options)
}
// from https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
let utoa = (str) => {
// first we use encodeURIComponent to get percent-encoded UTF-8,
// then we convert the percent encodings into raw bytes which
// can be fed into btoa.
return btoa(encodeURIComponent(str)
.replace(/%([0-9A-F]{2})/g,
(match, p1) => { return String.fromCharCode('0x' + p1) }))
}
// Params
// cropH
// cropW
@ -176,9 +166,9 @@ const register = (params) => {
})
}
const authHeaders = (user) => {
if (user && user.username && user.password) {
return { 'Authorization': `Basic ${utoa(`${user.username}:${user.password}`)}` }
const authHeaders = (accessToken) => {
if (accessToken) {
return { 'Authorization': `Bearer ${accessToken}` }
} else {
return { }
}