Merge branch 'issue-364-register-freeze' into 'develop'

#364: update ap_id error with username

Closes #364

See merge request pleroma/pleroma-fe!597
This commit is contained in:
Shpuld Shpludson 2019-02-19 18:00:39 +00:00
commit 40159324b4

View file

@ -231,8 +231,14 @@ const users = {
store.commit('setToken', result.access_token) store.commit('setToken', result.access_token)
store.dispatch('loginUser', result.access_token) store.dispatch('loginUser', result.access_token)
} else { } else {
let data = await response.json() const data = await response.json()
let errors = humanizeErrors(JSON.parse(data.error)) let errors = JSON.parse(data.error)
// replace ap_id with username
if (errors.ap_id) {
errors.username = errors.ap_id
delete errors.ap_id
}
errors = humanizeErrors(errors)
store.commit('signUpFailure', errors) store.commit('signUpFailure', errors)
throw Error(errors) throw Error(errors)
} }