Disallow accessing identity page when logged in
And disallow calls to fetchPerson when not our own profile or unlogged Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -161,6 +161,9 @@ import identityEditionMixin from "../../../mixins/identityEdition";
|
||||
return !this.identityName;
|
||||
},
|
||||
update: (data) => new Person(data.fetchPerson),
|
||||
error({ graphQLErrors }) {
|
||||
this.handleErrors(graphQLErrors);
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -321,6 +324,12 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
handleErrors(errors: any[]): void {
|
||||
if (errors.some((error) => error.status_code === 401)) {
|
||||
this.$router.push({ name: RouteName.LOGIN });
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
get getInstanceHost(): string {
|
||||
return MOBILIZON_INSTANCE_HOST;
|
||||
|
||||
Reference in New Issue
Block a user