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

Login issues #12

Open
yuuuiv opened this issue Jun 4, 2024 · 6 comments
Open

Login issues #12

yuuuiv opened this issue Jun 4, 2024 · 6 comments

Comments

@yuuuiv
Copy link

yuuuiv commented Jun 4, 2024

When I try to login, it seems like the uuid cannot be defined correctly.
Login with username and password:
7ef0934821682a94f2d40a6eaaf1d0c2
Login with cookies:
221f6bce1bff548659dc92316d76f8bf
By the way, could you please tell me which one between JSESSIONID and [email protected] is the one that contains session info? As I'm a freshman, I might need your further help...tks

@Lijilai-1024
Copy link

I met the same problem.

@PhotonQuantum
Copy link
Owner

Fixed in v0.4.2.

Regarding your question, I believe that both 'JSESSIONID' and ''`[email protected]' are involved in the authorization process.

@lan-qing
Copy link

I met the same problem in v0.4.2.

@lan-qing
Copy link

I met the same problem in v0.4.2.

It seems I solve it by setting validate_session=False again.

@PhotonQuantum
Copy link
Owner

@lan-qing Could you please provide more information? By setting validate_session to false, you lose the auto login function when the session expires.

@PhotonQuantum PhotonQuantum reopened this Nov 12, 2024
@lan-qing
Copy link

@lan-qing Could you please provide more information? By setting validate_session to false, you lose the auto login function when the session expires.

Dear PhotonQuantum,

Thanks for your reply. I installed pysjtu in a new python environment just now and met the same problem again. Here is the error message:

[Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysjtu
>>> c = pysjtu.create_client(username="xxx", password="xxx")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/client/__init__.py", line 71, in create_client
    sess = Session(*args, **kwargs)
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 122, in __init__
    self.loads({"username": username, "password": password})
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 429, in loads
    self.login(self._username, self._password)
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 368, in login
    result = self._secure_req(
  File "xxx/lib/python3.9/site-packages/pysjtu/session.py", line 85, in _secure_req
    return ref()
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 264, in post
    return self.request(
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 161, in request
    self.login(self._username, self._password)
  File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 359, in login
    uuid = re.findall(r"(?<=uuid=).*(?=\")", login_page_req.text)[0]
IndexError: list index out of range
>>> pysjtu.__version__
'0.4.2'

Is this sufficient to identify the problem? If anything more is helpful, I would be happy to provide it.

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

4 participants