chore(release): 0.4.0

This commit is contained in:
2026-05-05 15:00:14 +07:00
parent 5948d0e2a0
commit 9dfd0295d3
22 changed files with 239 additions and 89 deletions
+13 -3
View File
@@ -16,14 +16,24 @@ export function AcceptTermsForm() {
async function handleAccept() {
setError("");
setLoading(true);
const result = await acceptTermsAction();
const result = await acceptTermsAction({ accepted: checked });
if (result.error) {
setError(result.error);
setLoading(false);
return;
}
// Refresh JWT supaya middleware lihat acceptedTermsAndPrivacy=true
await update();
// Refresh JWT supaya middleware lihat acceptedTermsAndPrivacy=true.
// Kalau update() gagal (network), JWT callback di server akan re-fetch
// DB pada request berikutnya karena cookie token masih `false`.
try {
await update();
} catch {
setError(
"Persetujuan tersimpan, tapi sesi belum ter-refresh. Coba refresh halaman atau klik lagi."
);
setLoading(false);
return;
}
router.replace("/");
router.refresh();
}