update auth function