redex-ai / django-notes-app

0 stars 1 forks source link

REDEX #17

Open redex-ai opened 11 months ago

redex-ai commented 11 months ago

Add google auth to see home page

redex-ai-powered-okr-tool[bot] commented 11 months ago

Change Summary

To add Google authentication, we need to install the 'social-auth-app-django' package, configure the authentication backends in Django settings, add the necessary URLs, create a view and template for the home page that requires Google authentication, and create a login page with Google sign-in.

FilePlan :-

File : requirements.txt

Add 'social-auth-app-django' to the list of requirements to handle OAuth authentication with Google.

File : notesapp/settings.py

Add 'social_django' to the INSTALLED_APPS list and configure authentication backends to include Google OAuth. Also, add the Google OAuth credentials and define the LOGIN_URL, LOGIN_REDIRECT_URL, and LOGOUT_REDIRECT_URL.

File : notesapp/urls.py

Include the URLs for social authentication provided by 'social_django'.

File : api/views.py

Create a new view to handle the home page request which checks if a user is authenticated with Google before allowing access.

File : templates/home.html

Create a new HTML template for the home page if it does not exist. If it exists, ensure it has the necessary context to display user information.

File : notesapp/templates/social_auth/login.html

Create a new HTML template for the login page with a button to authenticate via Google.

Please review the structure and let me know if any modifications are required.

redex-ai-powered-okr-tool[bot] commented 11 months ago

PULL REQUEST : https://github.com/redex-ai/django-notes-app/pull/18