login controller raises error if environment vars are missing and redirects user to root if he's already logged in