before render a component I need to check whether the user authenticated. if not, the user will redirect to the login page.
I created a separate file with a class cal