auth UI and Api

This commit is contained in:
mohammad
2024-07-31 16:02:05 +03:00
parent 69abad24b7
commit 1d65617d18
13 changed files with 405 additions and 228 deletions

View File

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:syncrow_web/pages/auth/model/token.dart';
import 'package:syncrow_web/services/api/http_service.dart';
import 'package:syncrow_web/utils/constants/api_const.dart';
@ -43,17 +45,23 @@ class AuthenticationAPI {
return response;
}
static Future checkOtp({ required var email}) async {
static Future<bool> verifyOtp({ required String email, required String otpCode}) async {
final response = await HTTPService().post(
path: ApiEndpoints.sendOtp,
path: ApiEndpoints.verifyOtp,
body: {
"email": email,
"type": "VERIFICATION"
"email": email,
"type": "VERIFICATION",
"otpCode": otpCode
},
showServerMessage: true,
expectedResponseModel: (json) {
print('json===${json['message']}');
if(json['message']=='Otp Verified Successfully'){
return true;
}else{
return false;
}
});
return response;
}
}