Spaces:
Running
Running
Download api/views_auth.py from Dayozoe/harvestconnect-api: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/views_auth.py
- Command line
-
hf download hf://spaces/Dayozoe/harvestconnect-api/api/views_auth.py
-
curl -L -o views_auth.py https://huggingface.co/spaces/Dayozoe/harvestconnect-api/resolve/main/api/views_auth.py
1.09 kB
| from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter | |
| from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter | |
| from allauth.socialaccount.providers.oauth2.client import OAuth2Client | |
| from dj_rest_auth.registration.views import SocialLoginView | |
| from decouple import config | |
| from .serializers.social_auth_serializers import CustomSocialLoginSerializer | |
| class GoogleLogin(SocialLoginView): | |
| adapter_class = GoogleOAuth2Adapter | |
| serializer_class = CustomSocialLoginSerializer | |
| callback_url = config( | |
| 'GOOGLE_CALLBACK_URL', | |
| default=config('SITE_BASE_URL', default='https://v0-harvestconnect.vercel.app').rstrip('/') + '/auth/callback/google' | |
| ) | |
| client_class = OAuth2Client | |
| class GitHubLogin(SocialLoginView): | |
| adapter_class = GitHubOAuth2Adapter | |
| serializer_class = CustomSocialLoginSerializer | |
| callback_url = config( | |
| 'GITHUB_CALLBACK_URL', | |
| default=config('SITE_BASE_URL', default='https://v0-harvestconnect.vercel.app').rstrip('/') + '/auth/callback/github' | |
| ) | |
| client_class = OAuth2Client | |