Last fix to auth code. It works ok now.