Ask for the password once and retry when a machine requires elevation
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.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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() {}
|
||||
Reference in New Issue
Block a user