rework auth_begin