Add more info to introspection
This commit is contained in:
parent
c7a014f0b3
commit
444fff5b62
1 changed files with 17 additions and 1 deletions
|
@ -183,8 +183,24 @@ class ApiHelper {
|
||||||
).readAsString()),
|
).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(
|
return Response.ok(
|
||||||
json.encode({"active": true}),
|
json.encode({
|
||||||
|
"active": true,
|
||||||
|
"email": "$name@federated.nexus",
|
||||||
|
"name": name,
|
||||||
|
}),
|
||||||
headers: {"content-type": "application/json"},
|
headers: {"content-type": "application/json"},
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue