uwasystemhealth / IndEAAv2

A web application that streamlines course review by industry advisory panels. A complete rewrite of https://github.com/uwasystemhealth/IndEAA
4 stars 1 forks source link

Fix document download authentication #125

Closed peter-tanner closed 1 year ago

peter-tanner commented 1 year ago

Change Summary

Document generation was not working with the fixed authentication Download documents using axios to a temporary element, obtain the filename from the headers and then save as a file to the client

Change Form

Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.

Other Information

Maybe this should be merged with the google authentication branch first

frinzekt commented 1 year ago

letting you know in advance, the pytest are failing because we've changes the field name of the access and refresh token

=========================== short test summary info ============================
FAILED authentication/tests/test_authentication.py::test_login_username_and_password_get_jwt_and_user_info_success - assert 'access_token' in {'access': '***', 'user': {'pk': 2, 'username': 'admin', 'email': 'admin@admin.com', 'first_name': '', 'last_name': ''}}
 +  where {'access': '***', 'user': {'pk': 2, 'username': 'admin', 'email': 'admin@admin.com', 'first_name': '', 'last_name': ''}} = <Response status_code=200, "application/json">.data
FAILED authentication/tests/test_authentication.py::test_login_email_and_password_get_jwt_and_user_info_success - assert 'access_token' in {'access': '***', 'user': {'pk': 4, 'username': 'admin', 'email': 'admin@admin.com', 'first_name': '', 'last_name': ''}}
 +  where {'access': '***', 'user': {'pk': 4, 'username': 'admin', 'email': 'admin@admin.com', 'first_name': '', 'last_name': ''}} = <Response status_code=200, "application/json">.data
FAILED authentication/tests/test_authentication.py::test_reauthenticate_and_get_user_info_success - KeyError: 'access_token_expiration'

thats related to https://github.com/uwasystemhealth/IndEAAv2/pull/124

peter-tanner commented 1 year ago

thanks, I got this for the next change. I see they changed "access_token_expiration" to "access_expiration" in dj rest auth, but it seems like this is not in our tokens anymore since we got rid of SessionAuthentication? I will remove this from the tests if that's the case

github-actions[bot] commented 1 year ago

:white_check_mark: Result of Pytest Coverage

sentry-io[bot] commented 1 year ago

Suspect Issues

This pull request has been deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎