diff --git a/.gitignore b/.gitignore index 6500c0e..3bc06ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .dart_tool/ .direnv -secrets/ \ No newline at end of file +secret \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 64e643b..f4d08eb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,25 +5,19 @@ "version": "0.2.0", "configurations": [ { - "name": "nexusbot", + "name": "matrix-oauth2oidc", "program": "bin/nexusbot.dart", "args": [ - "--socket", - "./socket", "--homeserver", "https://matrix.federated.nexus", - "--name", - "nexusbot", - "--inviteTo", - "#community:federated.nexus", - "--adminRoom", - "#admins:federated.nexus", - "--successUri", - "https://federated.nexus/success", - "--botPasswordFile", - "secrets/botPassword.txt", - "--smtpPasswordFile", - "secrets/smtpPassword.txt" + "--jwtSecretFile", + "secret", + "--issuer", + "http://localhost:8080", + "--authorizeEndpoint", + "http://localhost:4321/login", + "--serviceDomain", + "federated.nexus" ], "request": "launch", "type": "dart" diff --git a/JUSTFILE b/JUSTFILE index 5fa18e3..0a86649 100644 --- a/JUSTFILE +++ b/JUSTFILE @@ -5,4 +5,4 @@ build: dart run build_runner build test: - curl --unix-socket ./socket http:/root -X POST -d '{"email": "foo", "username": "bar"}' \ No newline at end of file + oauth2c http://localhost:8080 --client-id yourclientid --scopes openid --grant-type authorization_code --auth-method none --response-mode query \ No newline at end of file diff --git a/lib/helpers/api_helper.dart b/lib/helpers/api_helper.dart index da9d2d6..5e9c42a 100644 --- a/lib/helpers/api_helper.dart +++ b/lib/helpers/api_helper.dart @@ -43,7 +43,7 @@ class ApiHelper { final response = await http.post( settings.homeserver.replace( path: - "_matrix/client/v3/rooms/${await getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}", + "_matrix/client/v3/rooms/${getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}", ), headers: await getHeaders(), body: json.encode({