Как получить доступ к токену после входа в систему с помощью google dj_rest_auth

Когда я посещаю этот url https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=<CALLBACK_URL_YOU_SET_ON_GOOGLE>&prompt=consent&response_type=token&client_id=&scope=openid%20email%20profile

перенаправляет на меня http://127.0.0.1:8000/accounts/google/login/callback/#access_token=tokonkey&token_type=Bearer&expires_in=3599&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.profile%20openid%20https://www.googleapis.com/auth/userinfo.email&authuser=0&prompt=consent

в ответ я получил

"успех"

Но я хочу получить access_token, который отображается в url, как

{

"token":tokenkey

}

может кто-нибудь подскажет мне, как это сделать?

И мой код выглядит следующим образом

В urls.py

from users.views import  GoogleLogin,GoogleRedirect
path('auth/google/', GoogleLogin.as_view(), name='google_login'),
path('accounts/google/login/callback/', GoogleRedirect.as_view())

в views.y

class GoogleLogin(SocialLoginView):
    adapter_class = GoogleOAuth2Adapter
    client_class = OAuth2Client
    
class GoogleRedirect(APIView):
    def get(self, request):
       
        return Response("success")
'''
Вернуться на верх