Skip to content

Commit

Permalink
Update API Login/Register
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftbird07 committed Jun 4, 2024
1 parent 05a5dd8 commit 14d940c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions buddytracker_app/lib/services/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_udid/flutter_udid.dart';

class AuthService {
static const String _baseUrl = 'https://yourapi.com/api/v1/auth';
static const String _baseUrl = 'https://test.buddytracker.app/api/v1/';

Future<String?> loginUserBasicAuth(String email, String password) async {
final response = await http.post(
Uri.parse('$_baseUrl/loginUser'),
Uri.parse('$_baseUrl/auth'), // "POST" to auth = login
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
Expand All @@ -31,7 +31,7 @@ class AuthService {

Future<String?> registerUserBasicAuth(String email, String password) async {
final response = await http.post(
Uri.parse('$_baseUrl/registerUser'),
Uri.parse('$_baseUrl/user'), // "POST" a user = register
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
Expand All @@ -50,7 +50,7 @@ class AuthService {

Future<String?> registerUserAnonymous(String email, String password) async {
final response = await http.post(
Uri.parse('$_baseUrl/registerUser'),
Uri.parse('$_baseUrl/user'), // "POST" a user = register
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
Expand Down

0 comments on commit 14d940c

Please sign in to comment.