Skip to content

Can't connect to multiple accounts #26

@Thomas-Fleming

Description

@Thomas-Fleming

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions