This repository was archived by the owner on Jun 13, 2023. It is now read-only.
Prevent possible runtime errors#7
Open
Basit-Balogun10 wants to merge 5 commits intoHackSoftware:mainfrom
Open
Conversation
added 5 commits
June 8, 2022 20:25
…' respectively in profile_data in auth/apis.py/GoogleLoginApi because Google returns the user_data in the latter format
…ndex.js and auth/apis.py
…to create superuser for testing purposes, not doing this raises TypeError of a missing positional argument 'username' in UserManager.createsuperuser()
…dler in users/selectors.py to fix TypeError due to too many arguments coming into the function
Member
|
Hello 👋 We'll be moving this repository to our Django Styleguide Example - HackSoftware/Django-Styleguide-Example#330 - so the examples are supported. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.