matrix-reportbot/get_access_token.py
Kumi 3d5e74c03b
refactor: simplify authentication process
Renamed `pantalaimon_first_login.py` to `get_access_token.py` to clarify its purpose for new developers. Removed dependency on `pantalaimon`, streamlining the project setup and reducing complexity. This change necessitates manual configuration for secure connections but simplifies the overall authentication flow. Also, deleted the example config file `pantalaimon.example.conf`, reinforcing the move away from Pantalaimon. This shifts the focus towards direct authentication methods, potentially improving future maintainability and ease of use.

# No specific issue references
```

```
refactor: streamline authentication by removing Pantalaimon

Renamed `pantalaimon_first_login.py` to `get_access_token.py` to make its purpose clear, especially for newcomers. This shift underscores our initiative to simplify the authentication process, directly aligning with our goal for a cleaner and less complex setup. By removing Pantalaimon dependencies, we not only reduce project complexity but also embrace a more straightforward authentication method. This decision involves moving away from automated secure connections provided by Pantalaimon, requiring manual configuration but ultimately leading to a leaner codebase and potentially enhancing maintainability and usability for developers.
2024-05-05 19:48:56 +02:00

22 lines
No EOL
509 B
Python

from nio import AsyncClient
from configparser import ConfigParser
async def main():
config = ConfigParser()
config.read("config.ini")
user_id = input("User ID: ")
password = input("Password: ")
client = AsyncClient(config["Matrix"]["Homeserver"])
client.user = user_id
await client.login(password)
print("Access token: " + client.access_token)
await client.close()
if __name__ == "__main__":
import asyncio
asyncio.get_event_loop().run_until_complete(main())