Use double quotes
This commit is contained in:
parent
53867e273b
commit
43ad7937f9
6 changed files with 49 additions and 49 deletions
|
@ -54,8 +54,8 @@ class ApiHelper {
|
|||
|
||||
Future<Response> bridgeHandler(Request request) async {
|
||||
final query = request.url.queryParameters;
|
||||
final code = query['code'];
|
||||
final redirectUri = query['redirect_uri'];
|
||||
final code = query["code"];
|
||||
final redirectUri = query["redirect_uri"];
|
||||
|
||||
if (code == null || redirectUri == null) {
|
||||
return Response(400, body: "Missing code or redirect_uri");
|
||||
|
@ -65,7 +65,7 @@ class ApiHelper {
|
|||
Request(
|
||||
"POST",
|
||||
Uri.base,
|
||||
body: utf8.encode('code=$code&client_id=proxy'),
|
||||
body: utf8.encode("code=$code&client_id=proxy"),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -76,8 +76,8 @@ class ApiHelper {
|
|||
return Response.found(
|
||||
redirectUri,
|
||||
headers: {
|
||||
'set-cookie':
|
||||
'id_token=${json.decode(await tokenRes.readAsString())["id_token"]}; Path=/; Secure; HttpOnly; SameSite=Lax; Domain=.${ref.watch(SettingsController.provider)!.serviceDomain}',
|
||||
"set-cookie":
|
||||
"id_token=${json.decode(await tokenRes.readAsString())["id_token"]}; Path=/; Secure; HttpOnly; SameSite=Lax; Domain=.${ref.watch(SettingsController.provider)!.serviceDomain}",
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class ApiHelper {
|
|||
|
||||
final user = codes[code]!;
|
||||
ref.read(AuthCodeController.provider.notifier).remove(code);
|
||||
final name = user.userId.split(':').first.replaceFirst('@', '');
|
||||
final name = user.userId.split(":").first.replaceFirst("@", "");
|
||||
|
||||
final jwt = JWT(
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ class ApiHelper {
|
|||
}
|
||||
|
||||
Future<Response> introspectionHandler(Request request) async {
|
||||
final token = Uri.splitQueryString(await request.readAsString())['token'];
|
||||
final token = Uri.splitQueryString(await request.readAsString())["token"];
|
||||
if (token == null) return Response(400, body: "Missing token");
|
||||
|
||||
try {
|
||||
|
@ -171,13 +171,13 @@ class ApiHelper {
|
|||
),
|
||||
);
|
||||
return Response.ok(
|
||||
json.encode({'active': true}),
|
||||
headers: {'content-type': 'application/json'},
|
||||
json.encode({"active": true}),
|
||||
headers: {"content-type": "application/json"},
|
||||
);
|
||||
} catch (_) {
|
||||
return Response.ok(
|
||||
json.encode({'active': false}),
|
||||
headers: {'content-type': 'application/json'},
|
||||
json.encode({"active": false}),
|
||||
headers: {"content-type": "application/json"},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue