mirror of
https://git.rape.pet/ulith/amputoma-fe.git
synced 2025-01-31 08:33:22 +01:00
make unauthorized error user-friendly
This commit is contained in:
parent
ceb17dd7eb
commit
a29ac91125
2 changed files with 3 additions and 0 deletions
|
@ -157,6 +157,8 @@ const UserProfile = {
|
||||||
const errorMessage = get(reason, 'error.error')
|
const errorMessage = get(reason, 'error.error')
|
||||||
if (errorMessage === 'No user with such user_id') { // Known error
|
if (errorMessage === 'No user with such user_id') { // Known error
|
||||||
this.error = this.$t('user_profile.profile_does_not_exist')
|
this.error = this.$t('user_profile.profile_does_not_exist')
|
||||||
|
} else if (errorMessage == 'This API requires an authenticated user') {
|
||||||
|
this.error = this.$t('user_profile.unauthorized')
|
||||||
} else if (errorMessage) {
|
} else if (errorMessage) {
|
||||||
this.error = errorMessage
|
this.error = errorMessage
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1202,6 +1202,7 @@
|
||||||
"user_profile": {
|
"user_profile": {
|
||||||
"profile_does_not_exist": "Sorry, this profile does not exist.",
|
"profile_does_not_exist": "Sorry, this profile does not exist.",
|
||||||
"profile_loading_error": "Sorry, there was an error loading this profile.",
|
"profile_loading_error": "Sorry, there was an error loading this profile.",
|
||||||
|
"unauthorized": "Please log in to view this profile.",
|
||||||
"timeline_title": "User timeline",
|
"timeline_title": "User timeline",
|
||||||
"field_validated": "Link Verified"
|
"field_validated": "Link Verified"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue