Skip to content

Conversation

@CaellumYHL
Copy link

Summary

JWT Authentication endpoints and configured roles for Volunteer/Admin.

Related Issues

  • Relates to #<3>

Changes

  • Imported JWT and JWT blacklist library
  • Removed username and modified fields
  • Added endpoints for login, registration, refresh, logout, and accessing user profile
  • Added permissions file with role checking
    - Added IsActiveAndNotExpired to handle volunteer access limits (Not yet implemented for current views)

How to Test

1.To Migrate: Run python manage.py migrate to create the new tables.
2. To Register: POST to /api/auth/register/ with email/password.
3. To Login: POST to /api/auth/login/ to receive an Access Token.
4. To check user data: GET /api/users/me/ with access token as Header.
5. To logout: POST the refresh token to /api/auth/logout/ with access token as Header

Checklist

  • Tests added or updated
  • CI passes (lint, tests, build)
  • Documentation updated (if behavior changed)
  • No secrets or credentials committed

Copy link
Contributor

@vivjd vivjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good! I tested this and it seems to work for basic use cases.

I didn't see any tests included in this PR, please add that when you get a chance!

@qiuethan
Copy link
Contributor

Hi Caellum, I fixed the key issue in the backend CI and merged it into your branch for you. Please take a look and let me know if there's any questions. The pipeline is passing for you now!

@CaellumYHL
Copy link
Author

Thank you Ethan and Vivian,

I've added some additional tests in the tests.py file and swapped the made up key so that it uses the server .env files. If I missed anything, please let me know!

@CaellumYHL CaellumYHL self-assigned this Dec 19, 2025
@qiuethan qiuethan requested a review from vivjd December 19, 2025 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants