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

Require token only in GET request #925

Open

Description

@fernando-s97

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.

Activity

  1. WinXaito commented on Feb 25, 2021

    @WinXaito

    +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions