got the login working on my machine p1
This commit is contained in:
parent
ed9d2d8a7b
commit
a86d713403
@ -9,7 +9,7 @@ import 'package:flutter/services.dart' show rootBundle;
|
||||
class AuthService {
|
||||
Future<bool> isUserLoggedIn() async {
|
||||
try {
|
||||
var url = Uri.http('127.0.0.1:3001', 'is_logged_in');
|
||||
var url = Uri.http('0.0.0.0:3001', 'is_logged_in');
|
||||
var response = await http.get(url);
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
@ -158,10 +158,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||
print(ip);
|
||||
print(port);
|
||||
|
||||
String baseUrl = "http://127.0.0.1:5000";
|
||||
|
||||
String baseUrl = "http://$ip:$port";
|
||||
print("baseurl " + baseUrl);
|
||||
print(baseUrl);
|
||||
try {
|
||||
final response = await http.get(Uri.parse('$baseUrl/read-config'));
|
||||
final response = await http.get(Uri.parse('http://localhost:6823/read-config'));
|
||||
print(response.statusCode);
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
@ -182,7 +183,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
print("past");
|
||||
|
||||
try {
|
||||
final sending = await http.post(Uri.parse('$baseUrl/update-config'),
|
||||
final sending = await http.post(Uri.parse('http://localhost:6823/update-config'),
|
||||
headers: {'Content-Type': "application/json"},
|
||||
body: jsonEncode(updates));
|
||||
print("sending");
|
||||
@ -192,7 +193,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
try {
|
||||
// String status = await http.post(Uri.parse(''))
|
||||
var url_log = Uri.http('127.0.0.1:3001', 'log_in');
|
||||
var url_log = Uri.http('localhost:6823', 'log_in');
|
||||
Map<String, dynamic> filteredData = {
|
||||
'email': updates['username'],
|
||||
'password': updates['password']
|
||||
|
Loading…
Reference in New Issue
Block a user