Skip to content

Conversation

@ckrew
Copy link
Contributor

@ckrew ckrew commented Dec 1, 2025

Description

This merge request updates the way that reactapps work with Tethys and authentication, namely shifting Tethys APIs from session and csrf based authentication to JSON Web Tokens (JWT).

Changes Made to Code

ReactApp Templates:

  • Removed getSession and getCSRF APIs
  • Added new getJWTToken and refreshJWTToken APIs
  • Updated loader to not use getSession and instead use JWTs

Tethys:

  • Removed get_session and get_csrf views and urls
  • updated whoami view
  • new APIs for token, token/refresh, and token/verify

Related PRs, Issues, and Discussions

Additional Notes

Quality Checks

  • At least one new test has been written for new code
  • New code has 100% test coverage
  • Code has been formatted with Black
  • Code has been linted with flake8
  • Docstrings for new methods have been added
  • The documentation has been updated appropriately

…oken will return the access and refresh token of an authenticated user or null if noone is logged in

in tethys, replace api views with django rest apis. removed csrf and session endpoints. updated whoami. added get_token
@ckrew ckrew requested a review from swainn December 1, 2025 22:59
@ckrew
Copy link
Contributor Author

ckrew commented Dec 15, 2025

@swainn any concerns here about backwards capabilities? should i include something that still works with the old stuff and add a deprecation warning?

@swainn
Copy link
Member

swainn commented Dec 15, 2025

@swainn any concerns here about backwards capabilities? should i include something that still works with the old stuff and add a deprecation warning?

Yes. Let's keep it backward compatible and add a deprecation warning.

@coveralls
Copy link

coveralls commented Dec 15, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling b315293 on api_view_updates
into 5011fa0 on main.

@ckrew
Copy link
Contributor Author

ckrew commented Dec 16, 2025

this is ready for review again. Let me know if there is anything else that needs to change

@ckrew
Copy link
Contributor Author

ckrew commented Dec 19, 2025

@swainn any concerns here about backwards capabilities? should i include something that still works with the old stuff and add a deprecation warning?

Yes. Let's keep it backward compatible and add a deprecation warning.

update this to it "will be deprecated and will be removed in a future tethys version"

@swainn swainn merged commit 110efb4 into main Dec 24, 2025
49 of 50 checks passed
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