Add more info to introspection

This commit is contained in:
Henry Hiles 2025-07-22 11:46:38 -04:00
commit 444fff5b62
No known key found for this signature in database

View file

@ -183,8 +183,24 @@ class ApiHelper {
).readAsString()),
),
);
final jwt = JWT.verify(
token,
SecretKey(
(await File.fromUri(
Uri.file(ref.read(SettingsController.provider)!.jwtSecretFile),
).readAsString()),
),
);
final name = jwt.issuer!.split(":").first.replaceFirst("@", "");
return Response.ok(
json.encode({"active": true}),
json.encode({
"active": true,
"email": "$name@federated.nexus",
"name": name,
}),
headers: {"content-type": "application/json"},
);
} catch (_) {