|
|
@@ -69,12 +69,8 @@ function appLogin(session, messages, errors) { |
|
|
|
} |
|
|
|
|
|
|
|
function restore(shortKey, longKey, password, messages, errors) { |
|
|
|
const requestOptions = { |
|
|
|
method: 'PUT', |
|
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
|
body: JSON.stringify({ 'data': longKey, 'password': password }) |
|
|
|
}; |
|
|
|
return fetch(`${config.apiUrl}/auth/restore/${shortKey}`, requestOptions) |
|
|
|
return fetch(`${config.apiUrl}/auth/restore/${shortKey}`, |
|
|
|
util.postWithAuth({ 'data': longKey, 'password': password })) |
|
|
|
.then(handleAuthResponse(messages, errors)); |
|
|
|
} |
|
|
|
|
|
|
@@ -82,7 +78,7 @@ function restoreFromPackage(shortKey, backupFileRef, password, messages, errors) |
|
|
|
let formData = new FormData(); |
|
|
|
formData.append('file', backupFileRef); |
|
|
|
formData.append('password', password); |
|
|
|
return fetch(`${config.apiUrl}/auth/restore/apply/${shortKey}`, util.putWithAuth(formData)) |
|
|
|
return fetch(`${config.apiUrl}/auth/restore/apply/${shortKey}`, util.postWithAuth(formData)) |
|
|
|
.then(util.handleAuthResponse(messages, errors)); |
|
|
|
} |
|
|
|
|
|
|
|