- private friendService: FriendService,
- private route: ActivatedRoute,
- private router: Router
- ) {
- this.isLoggedIn = this.authService.isLoggedIn();
+ private configService: ConfigService,
+ private userService: UserService,
+ private videoService: VideoService
+ ) {}
+
+ ngOnInit () {
+ this.authService.loadClientCredentials()
+
+ if (this.authService.isLoggedIn()) {
+ // The service will automatically redirect to the login page if the token is not valid anymore
+ this.userService.checkTokenValidity()
+ }
+
+ this.configService.loadConfig()
+ this.videoService.loadVideoCategories()
+ this.videoService.loadVideoLicences()
+ this.videoService.loadVideoLanguages()