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

Disallow multiple @useAuth usage #2787

Closed
catalinaperalta opened this issue Jan 10, 2024 · 1 comment · Fixed by #2958
Closed

Disallow multiple @useAuth usage #2787

catalinaperalta opened this issue Jan 10, 2024 · 1 comment · Fixed by #2958
Assignees
Labels
bug Something isn't working triaged:core
Milestone

Comments

@catalinaperalta
Copy link
Member

catalinaperalta commented Jan 10, 2024

Currently, having multiple @useAuth decorators for a service definition only takes the first one and ignores the second, see: Playground example

If this syntax is not supported we should have a linter rule warning against this.

@timotheeguerin
Copy link
Member

Might just need to call the validateUniqueOnNode helper for that decorator.

@markcowl markcowl added bug Something isn't working and removed needs-area labels Jan 11, 2024
@markcowl markcowl added this to the [2024] February milestone Jan 11, 2024
@markcowl markcowl changed the title Add linter rule for multiple @useAuth usage Disallow multiple @useAuth usage Jan 11, 2024
@timotheeguerin timotheeguerin self-assigned this Feb 27, 2024
timotheeguerin added a commit that referenced this issue Feb 28, 2024
fix #2787 

having multiple has no effect, the latest value will override the
previous ones so there is no reason to use `@useAuth` twice on the same
node

---------

Co-authored-by: Brian Terlson <[email protected]>
markcowl pushed a commit to markcowl/cadl that referenced this issue Mar 8, 2024
fix microsoft#2787 

having multiple has no effect, the latest value will override the
previous ones so there is no reason to use `@useAuth` twice on the same
node

---------

Co-authored-by: Brian Terlson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged:core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants