stablekernel/aqueduct

Require token only in GET request

fernando-s97 opened this issue · 1 comments

I have the following routes

router
      ..route("/graduates/auth/token").link(() => AuthController(authServer))
      ..route("/graduates[/:username]")
          .link(() => Authorizer.bearer(authServer))
          .link(() => GraduateController(context, authServer));

The GraduateController handles both GET and POST operations.

How can I make the Authorizer "only works when the operation is GET"? I want to be able to fetch specific data only with authentication, but I want to allow anyone to add data.

+1