ok
This commit is contained in:
@@ -2,7 +2,8 @@ import API_BASE_URL from "../config.js";
|
||||
|
||||
// Function to retrieve the authentication token from localStorage
|
||||
function getAuthToken() {
|
||||
return localStorage.getItem("auth");
|
||||
if (localStorage.getItem("auth")) return localStorage.getItem("auth");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Helper function to get headers with authentication token
|
||||
|
||||
@@ -274,7 +274,7 @@ export const handlePaymentFromGuestDevice = async (
|
||||
// Handle success response
|
||||
console.log("Transaction successful!");
|
||||
const data = await response.json();
|
||||
updateLocalStorage("auth", data.auth);
|
||||
if (data.newUser) updateLocalStorage("auth", data.auth);
|
||||
// Optionally return response data or handle further actions upon success
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user