Fix auth logic.

Fixed bypass issue in auth.