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