first working demo for local authentication
Placed authentication to an own file and handle redirect if not logged in