Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError at /api/google/login/: No exception message supplied #629

Open
kdocai opened this issue Apr 29, 2024 · 1 comment
Open

AssertionError at /api/google/login/: No exception message supplied #629

kdocai opened this issue Apr 29, 2024 · 1 comment

Comments

@kdocai
Copy link

kdocai commented Apr 29, 2024

I have crated a rest API to sign up and login user via Google , If I provide my token access_type and pass the token, the new user is signed up , but I am not able to hit the same api again and get a new JWT token

image

My setting.py is :

AUTHENTICATION_BACKENDS = (
   "django.contrib.auth.backends.ModelBackend",
   "allauth.account.auth_backends.AuthenticationBackend"
)
SOCIALACCOUNT_PROVIDERS = {
    'google': {
        'APP': {
            'client_id': '<client_id>',
            'secret': '<secret_key>',
            'key': ''
        },
        'SCOPE': [
            'profile',
            'email',
        ],
        "AUTH_PARAMS": {
            "access_type": "offline",
        }
    }
}

AUTH_USER_MODEL = 'users.User'
ACCOUNT_USER_MODEL_USERNAME_FIELD = None

REST_AUTH = {
    'USE_JWT' : True,
    'JWT_AUTH_HTTPONLY':False
}

My views.py is:

from dj_rest_auth.registration.views import SocialLoginView

class GoogleLoginView(SocialLoginView):
    adapter_class = GoogleOAuth2Adapter
@Goddy01
Copy link

Goddy01 commented Oct 30, 2024

I have crated a rest API to sign up and login user via Google , If I provide my token access_type and pass the token, the new user is signed up , but I am not able to hit the same api again and get a new JWT token

image

My setting.py is :

AUTHENTICATION_BACKENDS = (
   "django.contrib.auth.backends.ModelBackend",
   "allauth.account.auth_backends.AuthenticationBackend"
)
SOCIALACCOUNT_PROVIDERS = {
    'google': {
        'APP': {
            'client_id': '<client_id>',
            'secret': '<secret_key>',
            'key': ''
        },
        'SCOPE': [
            'profile',
            'email',
        ],
        "AUTH_PARAMS": {
            "access_type": "offline",
        }
    }
}

AUTH_USER_MODEL = 'users.User'
ACCOUNT_USER_MODEL_USERNAME_FIELD = None

REST_AUTH = {
    'USE_JWT' : True,
    'JWT_AUTH_HTTPONLY':False
}

My views.py is:

from dj_rest_auth.registration.views import SocialLoginView

class GoogleLoginView(SocialLoginView):
    adapter_class = GoogleOAuth2Adapter

How did you fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants