diff --git a/poverty-mapping/index.html b/poverty-mapping/index.html
index 97d3aba..39c3b48 100644
--- a/poverty-mapping/index.html
+++ b/poverty-mapping/index.html
@@ -582,8 +582,8 @@ function openAuthModal(mode){
resp = await fetch(endpoint, { method: 'POST', headers: buildHeaders(), body: JSON.stringify(payload), credentials: 'same-origin' });
jr = await resp.json().catch(()=>null);
}
- if(!resp.ok || (jr && jr.success === false)){
- showToast((jr && (jr.error || jr.status)) ? (jr.error || jr.status) : 'Gagal', 'error', 5000);
+ if(!resp.ok || !jr || jr.success === false){
+ showToast((jr && (jr.error || jr.status)) ? (jr.error || jr.status) : 'Gagal memproses respons dari server', 'error', 5000);
return;
}
if(mode === 'register'){
diff --git a/poverty-mapping/src/config/config.php b/poverty-mapping/src/config/config.php
index b5b21f1..70ceb30 100644
--- a/poverty-mapping/src/config/config.php
+++ b/poverty-mapping/src/config/config.php
@@ -12,8 +12,10 @@ function load_dotenv($path){
if((substr($v,0,1)==='"' && substr($v,-1)==='"') || (substr($v,0,1)==="'" && substr($v,-1)==="'")){
$v = substr($v,1,-1);
}
- putenv("$k=$v");
- $_ENV[$k] = $v;
+ if(getenv($k) === false){
+ putenv("$k=$v");
+ $_ENV[$k] = $v;
+ }
}
}
diff --git a/tugas-spbu/src/config/config.php b/tugas-spbu/src/config/config.php
index 998cefc..5353a3f 100644
--- a/tugas-spbu/src/config/config.php
+++ b/tugas-spbu/src/config/config.php
@@ -12,8 +12,10 @@ function load_dotenv($path){
if((substr($v,0,1)==='"' && substr($v,-1)==='"') || (substr($v,0,1)==="'" && substr($v,-1)==="'")){
$v = substr($v,1,-1);
}
- putenv("$k=$v");
- $_ENV[$k] = $v;
+ if(getenv($k) === false){
+ putenv("$k=$v");
+ $_ENV[$k] = $v;
+ }
}
}