Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Inheritance not working with @UseAuth #1535

Closed
1 task
sidharthv96 opened this issue Sep 21, 2021 · 4 comments
Closed
1 task

[BUG] Inheritance not working with @UseAuth #1535

sidharthv96 opened this issue Sep 21, 2021 · 4 comments
Assignees
Labels

Comments

@sidharthv96
Copy link
Contributor

Information

  • Version: 6.70.1
  • Packages:
    "@tsed/ajv": "^6.70.1",
    "@tsed/common": "^6.70.1",
    "@tsed/core": "^6.70.1",
    "@tsed/di": "^6.70.1",
    "@tsed/exceptions": "^6.70.1",
    "@tsed/json-mapper": "^6.70.1",
    "@tsed/mongoose": "^6.70.1",
    "@tsed/platform-express": "^6.70.1",
    "@tsed/schema": "^6.70.1",
    "@tsed/swagger": "^6.70.1",

I tried to implement inheritance as mentioned in https://tsed.io/docs/controllers.html#inheritance, but it won't work when @UseAuth decorator is used.

Will have routes from BaseController

@Controller("/parent")
export abstract class ChildController extends BaseController {

Will not have routes from BaseController

@Controller("/parent")
@UseAuth(UserAuthMiddleware)
export abstract class ChildController extends BaseController {

Acceptance criteria

  • Base routes should be available even when using @UseAuth Decorator
@sidharthv96
Copy link
Contributor Author

@Controller({
  path: "/parent",
  middlewares: {
    use: [UserAuthMiddleware],
  },
})

This works as a temp fix.

@sidharthv96
Copy link
Contributor Author

@Romakita
Copy link
Collaborator

Fixed by this pr #1545

@sidharthv96
Copy link
Contributor Author

Thanks a ton @Romakita !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants