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.
24 lines
653 B
Dart
24 lines
653 B
Dart
import 'dart:js_interop';
|
|
|
|
import 'package:web/web.dart' as web;
|
|
|
|
import 'session_security_api.dart';
|
|
|
|
/// Web: the browser sends the sign-in cookie to the page's own origin only.
|
|
Future<SecurityReply> sendSecurityRequest(String method, Uri uri) async {
|
|
final response = await web.window
|
|
.fetch(
|
|
uri.toString().toJS,
|
|
web.RequestInit(
|
|
method: method,
|
|
credentials: 'same-origin',
|
|
redirect: 'manual',
|
|
),
|
|
)
|
|
.toDart;
|
|
final body = (await response.text().toDart).toDart;
|
|
return (status: response.status, body: body);
|
|
}
|
|
|
|
void openWebSignIn() => web.window.location.assign('/login');
|