Fix: Add header in every API call.
" 'X-Login-Type': 'IB',"
This commit is contained in:
@@ -14,8 +14,8 @@ interface SendOtpPayload {
|
||||
}
|
||||
|
||||
function getStoredMobileNumber(): string {
|
||||
const mobileNumber = localStorage.getItem('remitter_mobile_no');
|
||||
// const mobileNumber = "7890544527";
|
||||
// const mobileNumber = localStorage.getItem('remitter_mobile_no');
|
||||
const mobileNumber = "7890544527";
|
||||
if (!mobileNumber) throw new Error('Mobile number not found.');
|
||||
return mobileNumber;
|
||||
}
|
||||
@@ -25,7 +25,10 @@ export async function sendOtp(payload: SendOtpPayload) {
|
||||
|
||||
const response = await fetch('/api/otp/send', {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Login-Type": "IB",
|
||||
},
|
||||
body: JSON.stringify({ ...payload, mobileNumber }),
|
||||
});
|
||||
|
||||
@@ -45,7 +48,7 @@ export async function verifyOtp(otp: string) {
|
||||
|
||||
const response = await fetch(`/api/otp/verify?mobileNumber=${mobileNumber}`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers: { "Content-Type": "application/json", "X-Login-Type": "IB" },
|
||||
body: JSON.stringify({ otp }),
|
||||
});
|
||||
|
||||
@@ -63,7 +66,7 @@ export async function verifyOtp(otp: string) {
|
||||
export async function verifyLoginOtp(otp: string, mobileNumber: string) {
|
||||
const response = await fetch(`/api/otp/verify?mobileNumber=${mobileNumber}`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers: { "Content-Type": "application/json", "X-Login-Type": "IB", },
|
||||
body: JSON.stringify({ otp }),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user