Skip to content

ctc-uci/authentication-backend

Repository files navigation

Backend Routes and Configuraiton - Table of Contents

This document serves as a guide to the various backend routes used in a typical backend application. Each route is listed with its location in the file and a brief description of its purpose. Use keywords like "verify token", "get user", "delete user", "add user", and "update user" to quickly find the relevant routes using "Ctrl + F".

Table of Contents

  1. Auth Routes

  2. Test Routes

  3. User Routes


Auth Routes

verifyToken Middleware

  • Location: Source
  • Description: Middleware to verify the access token attached to the request's cookies. This ensures that only users with appropriate access tokens can access backend routes.

GET /verifyToken/:accessToken

  • Location: Source
  • Description: Verifies the access token provided as a URL parameter. Returns the decoded token's UID if valid.

Test Routes

GET /

  • Location: Source
  • Description: Retrieves all users from the database. Useful for testing database connectivity and query execution.

User Routes

GET /

  • Location: Source
  • Description: Retrieves all users from the database.

GET /:userId

  • Location: Source
  • Description: Retrieves a specific user by their alphanumeric user ID.

DELETE /:userId

  • Location: Source
  • Description: Deletes a specific user by their alphanumeric user ID, both in Firebase and the NPO database.

POST /create

  • Location: Source
  • Description: Adds a new user to the database with the provided email, user ID, role, and registration status.

PUT /update/:userId

  • Location: Source
  • Description: Updates the registered flag for a specific user by their alphanumeric user ID.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published