Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

How do you allow only some get routes to have auth #230

@rodude123

Description

@rodude123

I'm making an API where some data is publicly available for my site and some need auth. I know I can add this,

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "rules" => [
        new Tuupola\Middleware\JwtAuthentication\RequestPathRule([
            "path" => "/",
            "ignore" => []
        ]),
        new Tuupola\Middleware\JwtAuthentication\RequestMethodRule([
            "ignore" => ["OPTIONS", "GET"]
        ])
    ]
]));

This allows all GET methods to have no auth on them. so is there a way to specify /projectData as a GET route that has no auth but /projetData as a POST, PUT, PATCH, DELETE routes have auth on them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions