Initial working of fully authenticated user login, uses hacky window. variables at the moment though