Skip to content

bug: how does Python client support multiple users #34

Open
@humpydonkey

Description

@humpydonkey

Describe the bug

I just have a question:
The python guide suggested using the python logto client instance as a global instance.

But looking at the implementation, i'm a bit confused:
how does logto client API, .e.gisAuthenticated() knows which user the "idToken" belongs to when there are multiple users try to login at same time?
Look at below python implementation, the storage key is just a static string, i.e. "idToken", it can't be used to differentiate different users who try to log in at the time.
the same question applies to other APIs like handleSignInCallback().

    def isAuthenticated(self) -> bool:
        """
        Check if the user is authenticated by checking if the ID Token exists.
        """
        return self._storage.get("idToken") is not None

In other words, when there are multiple users try to login at same time, wouldn't one signInSession overwrites other signInSession(s) because the key is just a static string?

Thanks

  • Logto Cloud
  • Self-hosted, Logto version =
    • Container (Docker image)
    • Raw Node.js

Screenshots

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions