Fix: Add header in every API call.

" 'X-Login-Type': 'IB',"
This commit is contained in:
2025-10-27 11:56:36 +05:30
parent 3f1bbf1a4c
commit 7ba258dc21
25 changed files with 55 additions and 13 deletions

View File

@@ -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 }),
});