aqueduct icon indicating copy to clipboard operation
aqueduct copied to clipboard

Require token only in GET request

Open fernando-s97 opened this issue 5 years ago • 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.

fernando-s97 avatar Dec 13 '20 05:12 fernando-s97

+1

WinXaito avatar Feb 25 '21 22:02 WinXaito