mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
auth UI and Api
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user