Fixes bug in authorization related to repositoryFactory