You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces the `@Auth` decorator to simplify authentication handling for API Gateway endpoints.
This allows developers to easily secure specific methods within a class-based endpoint by leveraging the router's `withAuth` middleware. The decorator supports optional parameters to enable or disable authentication requirements on a per-method basis.
Updates documentation to reflect the usage and execution order of the new decorator and its relation to other decorators like `@Before` and `@After`.
Copy file name to clipboardExpand all lines: README.md
+53-8Lines changed: 53 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -576,7 +576,7 @@ const records = event.records; // Works!
576
576
577
577
Acai-TS provides powerful method decorators for clean, declarative API Gateway endpoints using the class-based pattern.
578
578
579
-
> **⚠️ Important**: The `@Before`, `@After`, `@Timeout`, and `@Validate` decorators are for **Router/API Gateway endpoints only** and work on **class methods** (not classes or standalone functions).
579
+
> **⚠️ Important**: The `@Before`, `@After`, `@Auth`, `@Timeout`, and `@Validate` decorators are for **Router/API Gateway endpoints only** and work on **class methods** (not classes or standalone functions).
580
580
>
581
581
> For **event handlers** (DynamoDB, S3, SQS), these decorators will not work. Instead, use:
582
582
> -**Function wrapper patterns** (see Event Processing Patterns section)
@@ -621,7 +621,7 @@ Best for complex endpoints with multiple methods and middleware:
0 commit comments