remove unused logout and user profile methods from AuthService

This commit is contained in:
Md Asif 2025-06-01 13:03:53 +05:30
parent faf478a7b0
commit 7c9e089c62

View File

@ -1,10 +1,7 @@
import 'dart:developer';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../../features/auth/models/auth_token.dart'; import '../../features/auth/models/auth_token.dart';
import '../../features/auth/models/auth_credentials.dart'; import '../../features/auth/models/auth_credentials.dart';
import '../../data/models/user.dart';
import '../../core/errors/exceptions.dart'; import '../../core/errors/exceptions.dart';
@ -54,30 +51,4 @@ class AuthService {
} }
} }
Future<void> logout(String refreshToken) async {
try {
await _dio.post(
'/auth/logout',
data: {'refresh_token': refreshToken},
);
} catch (e) {
// We might want to just log this error rather than throwing,
// as logout should succeed even if the server call fails
log('Logout error: ${e.toString()}');
}
}
Future<User> getUserProfile() async {
try {
final response = await _dio.get('/auth/profile');
if (response.statusCode == 200) {
return User.fromJson(response.data);
} else {
throw AuthException('Failed to get user profile');
}
} catch (e) {
throw AuthException('Error fetching user profile: ${e.toString()}');
}
}
} }