fix(auth): Android login local server not starting

This commit is contained in:
Kingkor Roy Tirtho 2022-09-14 22:54:00 +06:00
parent 08575e3d09
commit 4b9792c34a
2 changed files with 16 additions and 2 deletions

View File

@ -62,6 +62,16 @@ class LoginForm extends HookConsumerWidget {
const SizedBox(height: 20),
ElevatedButton(
onPressed: () async {
if (clientSecretController.text.isEmpty ||
clientIdController.text.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("Please fill in all fields"),
behavior: SnackBarBehavior.floating,
),
);
return;
}
await handleLogin(authState);
},
child: const Text("Submit"),

View File

@ -184,8 +184,12 @@ abstract class ServiceUtils {
mode: LaunchMode.externalApplication,
);
HttpServer server =
await HttpServer.bind(InternetAddress.loopbackIPv4, 4304);
HttpServer server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
4304,
shared: true,
);
logger.i("[connectIpc] Server started");
await for (HttpRequest request in server) {