Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Mistake in auth provider callbacks documentation #12534

@hannesharnisch

Description

@hannesharnisch

The example of the password auth provider callbacks does not work because it returns a string instead of a Tuple[string,...]:

async def check_my_login(
        self,
        username: str,
        login_type: str,
        login_dict: "synapse.module_api.JsonDict",
    ) -> Optional[
        Tuple[
            str,
            Optional[Callable[["synapse.module_api.LoginResponse"], Awaitable[None]]],
        ]
    ]:
        if login_type != "my.login_type":
            return None

        if self.credentials.get(username) == login_dict.get("my_field"):
            return self.api.get_qualified_user_id(username)

Link: https://matrix-org.github.io/synapse/develop/modules/password_auth_provider_callbacks.html

If you try to use it it throws an error, that the returned type is not of type Tuple[string,...]

It works if you use:

return (self.api.get_qualified_user_id(username),None)

Metadata

Metadata

Assignees

Labels

A-Docsthings relating to the documentationT-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions