Commit 41f27df2 authored by Mark Harding's avatar Mark Harding

(fix): do not allow banned page to be show to banned users

No related merge requests found
Pipeline #61880180 failed with stage
in 7 minutes and 15 seconds
......@@ -8,10 +8,16 @@ export class BannedService {
constructor(private router: Router, private session: Session) {
this.router.events.subscribe((navigationState) => {
if (navigationState instanceof NavigationStart) {
// Forward to moderation banned page if banned
if (this.session.getLoggedInUser().banned === 'yes'
&& navigationState.url != '/moderation/banned') {
this.router.navigate(['/moderation/banned']);
}
// Do not allow access to banned page if not banned
if (this.session.getLoggedInUser().banned !== 'yes'
&& navigationState.url === '/moderation/banned') {
this.router.navigate(['/newsfeed']);
}
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment