Fixed auth logic