Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Require token only in GET request #925

Open
fernando-s97 opened this issue Dec 13, 2020 · 1 comment
Open

Require token only in GET request #925

fernando-s97 opened this issue Dec 13, 2020 · 1 comment

Comments

@fernando-s97
Copy link

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.

@WinXaito
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants