Skip to content

Add authentication decorators #5

@jb3

Description

@jb3

Right now the authentication route will set an admin property to True in the token if a record exists in the admin collection that looks like:

{
  "_id": "112233445566778899"
}

Let's write a couple of decorators for use across the application:

  1. Validate that tokens provided in the Authorization header are legitimate (signed by us), else return an error.
  2. Validate that the authentic token has admin set to true, else return an unauthorized error.

Metadata

Metadata

Assignees

Labels

P1High priority tasks.area: adminCode relating to admin functionality like creating and reading form responses.area: authenticationCode relating to authentication with the backend service, typically for admin only routes.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions