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,23 @@
|
||||
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');
|
||||
Reference in New Issue
Block a user