This repository was archived by the owner on Jun 13, 2023. It is now read-only.
Prevent possible runtime errors #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
givenNameandfamilyNamevariables togiven_nameandfamily_nameto ensureprofile_datais properly obtained fromuser_dataas the user info endpoint (https://www.googleapis.com/oauth2/v3/userinfo)returnsgiven_nameandfamily_nameinstead of the former.app_namevariable inapi/urls.pyhelps preventNoReverseMatchErrorin GoogleLoginApi while reverse function to get api_uri from urls namespaces. This can also be fixed by replacing the second url pattern inconfig/urls.pywithpath('api/', include(('api.urls', 'api'), namespace='api')),redirect_uri mismatcherrors can easily arise from trailing slashes being the subtle difference between the authorized redirect URIs in the Google console and theredirect_urivalue used in the codebase. A quick warning on this can save someone hours of debugging.REQUIRED_FIELDSinusers/models.pyhelps to prevent a TypeError from a missing required positional argument (username) in the create_superuser function in theUserManager. This makes it possible to create superusers for testing purposesissued_at’ as the fourth argument ofjwt_response_payload_handlerto fixTypeError` as a result of excessive arguments (4) coming from https://github.com/Styria-Digital/django-rest-framework-jwt/blob/master/src/rest_framework_jwt/views.py#L34 instead of expected three(3) arguments of the function. This error prevents the traditional email-password login flow from happening successfully.