implmnt generateAuthorized and update authIdx type