First working version with auth, logging in and checking for token