def authenticate(self, request, **credentials): """Only authenticates, does not actually login. See `login`""" from allauth.account.auth_backends import AuthenticationBackend self.pre_authenticate(request, **credentials) AuthenticationBackend.unstash_authenticated_user() user = authenticate(request, **credentials) alt_user = AuthenticationBackend.unstash_authenticated_user() user = user or alt_user if user and app_settings.LOGIN_ATTEMPTS_LIMIT: self._delete_login_attempts_cached_email(request, **credentials) else: self.authentication_failed(request, **credentials) return user
def authenticate(self, request, **credentials): """Only authenticates, does not actually login. See `login`""" from allauth.account.auth_backends import AuthenticationBackend self.pre_authenticate(request, **credentials) AuthenticationBackend.unstash_authenticated_user() user = authenticate(request, **credentials) alt_user = AuthenticationBackend.unstash_authenticated_user() user = user or alt_user if user and app_settings.LOGIN_ATTEMPTS_LIMIT: cache_key = self._get_login_attempts_cache_key( request, **credentials) cache.delete(cache_key) else: self.authentication_failed(request, **credentials) return user
def authenticate(self, request, **credentials): """Only authenticates, does not actually login. See `login`""" from allauth.account.auth_backends import AuthenticationBackend self.pre_authenticate(request, **credentials) AuthenticationBackend.unstash_authenticated_user() user = authenticate(request, **credentials) alt_user = AuthenticationBackend.unstash_authenticated_user() user = user or alt_user if user: cache_key = self._get_login_attempts_cache_key( request, **credentials) cache.delete(cache_key) else: self.authentication_failed(request, **credentials) return user