def get()

in pulseapi/users/utils.py [0:0]


    def get(self, request, *args, **kwargs):
        if settings.USE_RECAPTCHA:
            client_token = request.GET.get('token', None)

            if client_token is None:
                return HttpResponseForbidden()

            if not verify_recaptcha(client_token):
                return HttpResponseForbidden()

            """
            note the token in the session, so that the redirect
            to `accounts/login` works. This allows us to write code
            that prevents users from directly accessing the allauth
            login route, thus preventing recaptcha circumvention.
            """
            request.session['recaptcha_token'] = client_token

        return super().get(request, *args, **kwargs)