Skip to content

[FEAT] Reuse the session after client initialization #66

@darshil-lakhani

Description

@darshil-lakhani

Current Behavior:

Currently when we initialize the client using the below mentioned code

from neo_api_client import NeoAPI
client = NeoAPI(consumer_key="", consumer_secret="", 
                environment='uat', on_message=on_message, on_error=on_error, on_close=None, on_open=None)
client.login(mobilenumber="+919999999999", password="XXXX")
client.session_2fa(OTP="")

We are unable to reuse the session token for further initialization.

Expected Behavior:

We Should be able to initiate the client using something like

reuse_session = {}
client = NeoAPI(access_token="",environment="prod",reuse_session=reuse_session)
#or
client = NeoAPI(consumer_key="", consumer_secret="",reuse_session=reuse_session
                environment='prod')

(You can use on_message, on_error , on_close and on_open in both the ways )
By doing so we should be able to able to initialize the client without using username, password, OTP or MPIN

But currently we are not able to do that, it gives us this error when we try to access any method of client object

{'Error Message': 'Complete the 2fa process before accessing this application'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions