Done Category, Product Catalogue, Customer, Vendor, Purchase Invoice Module
This commit is contained in:
@@ -17,7 +17,7 @@ class AuthController extends AsyncNotifier<void> {
|
||||
state = const AsyncValue.loading();
|
||||
try {
|
||||
final data = await _repository.login(email, password);
|
||||
await DioClient().storage.write(key: 'jwt_token', value: data['token']);
|
||||
await DioClient().saveToken(data['token']);
|
||||
state = const AsyncValue.data(null);
|
||||
return true;
|
||||
} catch (e, st) {
|
||||
@@ -42,7 +42,7 @@ class AuthController extends AsyncNotifier<void> {
|
||||
state = const AsyncValue.loading();
|
||||
try {
|
||||
final data = await _repository.verifyOtp(email, otp);
|
||||
await DioClient().storage.write(key: 'jwt_token', value: data['token']);
|
||||
await DioClient().saveToken(data['token']);
|
||||
state = const AsyncValue.data(null);
|
||||
return true;
|
||||
} catch (e, st) {
|
||||
@@ -63,7 +63,11 @@ class AuthController extends AsyncNotifier<void> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> resetPassword(String email, String otp, String newPassword) async {
|
||||
Future<bool> resetPassword(
|
||||
String email,
|
||||
String otp,
|
||||
String newPassword,
|
||||
) async {
|
||||
state = const AsyncValue.loading();
|
||||
try {
|
||||
await _repository.resetPassword(email, otp, newPassword);
|
||||
|
||||
Reference in New Issue
Block a user