Files
pipelines/app/lib/features/settings/security/session_security_http_web.dart
T
alan 9702d68d2d 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.
2026-11-10 01:21:28 +00:00

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');