Compare commits

...

2 commits

Author SHA1 Message Date
74a634c642
Add testing 2025-08-01 16:33:01 -04:00
eca414cad9
Fix bug 2025-08-01 16:32:58 -04:00
4 changed files with 18 additions and 12 deletions

2
.gitignore vendored
View file

@ -1,3 +1,3 @@
.dart_tool/ .dart_tool/
.direnv .direnv
secret secrets/

24
.vscode/launch.json vendored
View file

@ -5,19 +5,25 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "matrix-oauth2oidc", "name": "nexusbot",
"program": "bin/nexusbot.dart", "program": "bin/nexusbot.dart",
"args": [ "args": [
"--socket",
"./socket",
"--homeserver", "--homeserver",
"https://matrix.federated.nexus", "https://matrix.federated.nexus",
"--jwtSecretFile", "--name",
"secret", "nexusbot",
"--issuer", "--inviteTo",
"http://localhost:8080", "#community:federated.nexus",
"--authorizeEndpoint", "--adminRoom",
"http://localhost:4321/login", "#admins:federated.nexus",
"--serviceDomain", "--successUri",
"federated.nexus" "https://federated.nexus/success",
"--botPasswordFile",
"secrets/botPassword.txt",
"--smtpPasswordFile",
"secrets/smtpPassword.txt"
], ],
"request": "launch", "request": "launch",
"type": "dart" "type": "dart"

View file

@ -5,4 +5,4 @@ build:
dart run build_runner build dart run build_runner build
test: test:
oauth2c http://localhost:8080 --client-id yourclientid --scopes openid --grant-type authorization_code --auth-method none --response-mode query curl --unix-socket ./socket http:/root -X POST -d '{"email": "foo", "username": "bar"}'

View file

@ -43,7 +43,7 @@ class ApiHelper {
final response = await http.post( final response = await http.post(
settings.homeserver.replace( settings.homeserver.replace(
path: path:
"_matrix/client/v3/rooms/${getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}", "_matrix/client/v3/rooms/${await getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}",
), ),
headers: await getHeaders(), headers: await getHeaders(),
body: json.encode({ body: json.encode({