Skip to content

Implement X-Uiuc-Token handling in a reusable hook #473

@devksingh4

Description

@devksingh4

X-Uiuc-Token is currently handled as a bespoke authorization system, including:

  • adding header to zod schema
  • checking validity of token
  • getting info from token

While there are functions for this, we write the calling/logic everywhere we need it (it was intended to be a one-time hack, but has turned into something we use whenever we need to get identities of people who aren't necessarily ACM paid members).

We should handle this in the same way that we handle the withAuth hook for ACM auth, and add the UIUC profile to the request context like we do for withAuth. The behavior should be as close to withAuth as possible, including adding to the docs automatically etc.

End deliverable is to create the hook withUiucAuth that behaves similarly to the withAuth hook that abstracts away this process of verifying UIUC ID tokens.

Once this is done, we should port the current routes doing it manually to using this hook.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions