1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Create login widget

This commit is contained in:
2021-04-17 09:52:05 +02:00
parent d426bf1eb6
commit dafa9e157a
3 changed files with 118 additions and 111 deletions

View File

@ -1,4 +1,3 @@
import 'package:comunic/helpers/api_helper.dart';
import 'package:comunic/helpers/preferences_helper.dart';
import 'package:comunic/helpers/push_notifications_helper.dart';
import 'package:comunic/helpers/websocket_helper.dart';
@ -44,11 +43,10 @@ class AccountHelper {
/// Sign in user
Future<AuthResult> signIn(AuthenticationDetails auth) async {
final request = APIRequest(uri: "account/login");
request.addString("mail", auth.email);
request.addString("password", auth.password);
final response = await APIHelper().exec(request);
final response = await APIRequest.withoutLogin("account/login")
.addString("mail", auth.email)
.addString("password", auth.password)
.exec();
// Handle errors
if (response.code == 401)