9702d68d2d
Carry the protocol error code, wrap each machine's gateway so an elevation_required refusal shows one native password dialog, elevates that connection and retries; send the upload token with file uploads; add a Settings sign-in security section with the weak-password warning and sign out everywhere; accept the __Host- session cookie.
23 lines
800 B
Dart
23 lines
800 B
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import '../../../core/session/server_session.dart';
|
|
import 'session_security_api.dart';
|
|
|
|
/// Native: the kept session cookie, only for the selected server's origin.
|
|
Future<SecurityReply> sendSecurityRequest(String method, Uri uri) async {
|
|
final client = HttpClient()..connectionTimeout = const Duration(seconds: 10);
|
|
try {
|
|
final request = await client.openUrl(method, uri);
|
|
request.followRedirects = false;
|
|
ServerSession.headersFor(uri).forEach(request.headers.set);
|
|
final response = await request.close().timeout(const Duration(seconds: 15));
|
|
final body = await response.transform(utf8.decoder).join();
|
|
return (status: response.statusCode, body: body);
|
|
} finally {
|
|
client.close(force: true);
|
|
}
|
|
}
|
|
|
|
void openWebSignIn() {}
|