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

Can't connect to multiple accounts #26

Open
Thomas-Fleming opened this issue Jul 8, 2016 · 0 comments
Open

Can't connect to multiple accounts #26

Thomas-Fleming opened this issue Jul 8, 2016 · 0 comments

Comments

@Thomas-Fleming
Copy link
Contributor

Thomas-Fleming commented Jul 8, 2016

If I call the following code more than once in a single process, using different developer tokens, the SharedSession continues to use the developer token that was supplied first.

ENSessionAdvanced.SetSharedSessionDeveloperToken(sessionDeveloperToken, sessionNoteStoreUrl);

if (ENSession.SharedSession.IsAuthenticated == false)
{
    ENSession.SharedSession.AuthenticateToEvernote();
}

Calling AuthenticateToEvernote() without checking IsAuthenticated makes no difference. ENSession continues to connect to the first users account.

I've had a skim through the code and it appears that it is intentionally a singleton whose state cannot be changed once it is initialised. The only way I can find to get around this without restarting the process is to use reflection to manually reset the internal state. Obviously this is not an appropriate solution.

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

1 participant