Describe the bug
I also described the behaviour here: surrealdb/docs.surrealdb.com#1958
the connection object stores the last session's JWT and on attempting to create a .new_session() a surrealdb.errors.NotAllowedError: The token has expired is raised because it automatically tries to authenticate with the existing token, even if its not desired. So if I want to signin on a new session, I cannot because the JWT prevents the session from being created
Steps to reproduce
database_connection = AsyncWsSurrealConnection(f"ws://{ip}:{port}/rpc")
#create a new session, signin on session
#wait for session JWT to expire
database_connection.new_session() #exception raised
Expected behaviour
the exception to not be raised, a new session created
Workaround: catch NotAllowedError and call connection.invalidate()
SurrealDB version
3.1.5
surrealdb.py version
3.0 beta7
Contact Details
No response
Is there an existing issue for this?
Code of Conduct for repository surrealdb/surrealdb.py
Describe the bug
I also described the behaviour here: surrealdb/docs.surrealdb.com#1958
the connection object stores the last session's JWT and on attempting to create a
.new_session()asurrealdb.errors.NotAllowedError: The token has expiredis raised because it automatically tries to authenticate with the existing token, even if its not desired. So if I want to signin on a new session, I cannot because the JWT prevents the session from being createdSteps to reproduce
Expected behaviour
the exception to not be raised, a new session created
Workaround: catch
NotAllowedErrorand callconnection.invalidate()SurrealDB version
3.1.5
surrealdb.py version
3.0 beta7
Contact Details
No response
Is there an existing issue for this?
Code of Conduct for repository surrealdb/surrealdb.py