Skip to content

Commit c22156d

Browse files
author
rtucker-mozilla
authored
Merge pull request #650 from rtucker-mozilla/master
Checking for authentication on profile pages by PageProfile.vue first
2 parents 0536320 + b19bc35 commit c22156d

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

src/components/profile/Profile.vue

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<template>
2-
<main class="profile" >
3-
<div
4-
v-if="typeof(accessInformation) === 'undefined'"
5-
>
6-
<p>
7-
You must login to view profile.
8-
</p>
9-
</div>
10-
<div
11-
v-if="typeof(accessInformation) != 'undefined'"
12-
>
2+
<main class="profile">
133
<div
144
:class="
155
'profile__section' +
@@ -243,7 +233,6 @@
243233
></ViewKeys>
244234
</template>
245235
</ProfileSection>
246-
</div>
247236
</main>
248237
</template>
249238

@@ -354,11 +343,7 @@ export default {
354343
};
355344
},
356345
userOnOwnProfile() {
357-
try {
358-
return this.$store.state.scope.uuid === this.uuid.value;
359-
} catch(e){
360-
return false;
361-
}
346+
return this.$store.state.scope.uuid === this.uuid.value;
362347
},
363348
identitiesWrapper() {
364349
return new Identities(this.identities);
@@ -467,4 +452,4 @@ export default {
467452
top: -7em;
468453
}
469454
}
470-
</style>
455+
</style>

src/pages/PageProfile.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
:allowStaffOnlyFields="allowStaffOnlyFields"
2424
></Profile>
2525
</template>
26+
<PagePermissionRequired v-else-if="error && (!data)"></PagePermissionRequired>
2627
<Page404 v-else-if="error || (data && data.profile === null)"></Page404>
2728
<LoadingSpinner v-else></LoadingSpinner>
2829
</template>
@@ -36,6 +37,7 @@ import { DISPLAY_PROFILE } from '@/queries/profile';
3637
import Related from '@/assets/js/related';
3738
import PreviewAs from '@/components/profile/PreviewAs.vue';
3839
import Page404 from './PageUnknown.vue';
40+
import PagePermissionRequired from './PagePermissionRequired.vue';
3941
4042
export default {
4143
name: 'PageProfile',

0 commit comments

Comments
 (0)