Skip to content

Commit

Permalink
refactor(dotnet-auth): delete test logs
Browse files Browse the repository at this point in the history
  • Loading branch information
morhag90 committed Jun 3, 2024
1 parent 30b7545 commit 9a760d3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions plugins/dotnet-auth-core-identity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,25 +349,20 @@ class AuthCorePlugin implements dotnetTypes.AmplicationPlugin {
eventParams: dotnet.CreateControllerBaseModuleFileParams,
files: FileMap<Class>
): FileMap<Class> {
console.log("afterCreateControllerBaseModule");

const { controllerBaseModuleBasePath, moduleActionsAndDtos } = eventParams;
const { roles } = context;
const roleNames = roles?.map((role) => role.name).join(",");

const moduleName = moduleActionsAndDtos.moduleContainer.name;
const pascalPluralName = pascalCase(moduleName);
console.log(files);

const controllerBaseFile = files.get(
`${controllerBaseModuleBasePath}/${moduleName}/Base/${pascalPluralName}ControllerBase.cs`
);
console.log(controllerBaseFile);

if (!controllerBaseFile) return files;

const methods = controllerBaseFile.code.getMethods();
console.log({ methods });
roleNames &&
methods?.forEach((method) => {
createMethodAuthorizeAnnotation(method, roleNames);
Expand Down

0 comments on commit 9a760d3

Please sign in to comment.