Skip to content

Sauth Frontend — Changelog

v0.3.1 (2026-06-22)

TL;DR

Perubahan:

  • 🐛 Fixed: setCookie hardcoded Secure flag menyebabkan cookie tidak tersimpan di HTTP (Low) — Safari dan browser non-Chrome di HTTP silently drop cookie; sekarang conditional per protocol

Impact: 🔵 Low: 1

Backward Compatible: ✅ Ya

🔵 Low Impact

Perubahan:

  • Bug fix: setCookie tidak lagi hardcode SameSite=None; Secure — HTTPS pakai SameSite=None; Secure, HTTP pakai SameSite=Lax

v0.3.0 (2026-05-25)

TL;DR

Perubahan:

  • ✨ New: isFirstPartyToken, isThirdPartyToken, isM2MToken (High) — helper identifikasi jenis token dari decoded claims
  • 🔵 Low: Field fp ditambah ke SauthTokenClaims (Low) — reflect klaim baru sauth-server v0.3+

Impact: ✨ New: 3 | 🔵 Low: 1

Backward Compatible: ✅ Ya

NOTE

Versi loncat dari 0.1.10.3.0 untuk lockstep dengan sauth-server v0.3.0 dan sauth-client v0.3.0 pada shared claim contract release.

✨ New

Token Type Helpers — isFirstPartyToken, isThirdPartyToken, isM2MToken

Tiga helper baru di auth/token untuk mengidentifikasi jenis token dari decoded claims, mirror dari method MicroserviceUser di sauth-client PHP. Helper menerima SauthTokenClaims — caller decode dulu dengan decodeTokenClaims(). Mendukung token pre-v0.3 via fallback inference dari scope-presence saat fp tidak ada.

Poin utama:

  • isFirstPartyTokenfp='1p' atau (fallback) scope absent
  • isThirdPartyTokenfp='3p' atau (fallback) scope present
  • isM2MTokensnm absent; tidak bergantung pada fp
fpisFirstPartyTokenisThirdPartyToken
'1p'truefalse
'3p'falsetrue
absent!claims.scope!!claims.scope

Lihat: SauthTokenClaims | Example 8

🔵 Low Impact

Perubahan:

  • Field fp?: '1p' | '3p' ditambah ke SauthTokenClaims dan SauthInertiaAuth — opsional, tidak merusak app yang belum deploy sauth-server v0.3

v0.1.1 (2026-05-22)

TL;DR

Perubahan:

  • 🔥 Breaking: Rename cookie prefix default — tkaac_tkac_, tkarf_tkrf_ (Breaking) — cookie lama tidak lagi dibaca setelah upgrade
  • 🔧 Improved: refreshTokenTtl option baru (Medium) — refresh cookie sekarang persistent default 7 hari; sebelumnya session cookie
  • 🐛 Fixed: SauthTokenClaims.exp jadi opsional, tambah jti (Low) — fix type untuk API key JWT

Impact: 🔴 Breaking: 1 | 🟢 Medium: 1 | 🔵 Low: 1

Backward Compatible: ❌ Tidak

🔴 Breaking Changes

Prefix default cookie dipersingkat untuk konsistensi penamaan ekosistem. App yang tidak mengeset accessTokenPrefix secara eksplisit akan membuat cookie dengan nama baru — cookie lama tidak lagi dibaca.

ts
// Sebelum (v0.1.0) — cookie yang dibuat
tkaac_{service}   // access token
tkarf_{service}   // refresh token

// Sesudah (v0.1.1) — cookie yang dibuat
tkac_{service}    // access token
tkrf_{service}    // refresh token

Fix:

  1. App yang sudah set accessTokenPrefix eksplisit tidak terdampak — prefix manual tidak berubah.
  2. Tanpa tindakan: setelah deploy, cookie lama tidak dibaca — user mendapat satu request ekstra untuk re-issue token (session mode) atau redirect login (pkce mode). Tidak ada data loss.
  3. Untuk migrate bertahap: set accessTokenPrefix: 'tkaac_' sementara, hapus setelah deployment stabil.

🟢 Medium Impact

Peningkatan:

  • refreshTokenTtl option baru — refresh cookie sekarang persistent (default 604800s = 7 hari), sesuai sauth-server.token_ttl.refresh; sebelumnya session cookie yang hilang saat browser ditutup

🔵 Low Impact

Perubahan:

  • Bug fix: SauthTokenClaims.exp jadi opsional, tambah field jti? — fix type mismatch untuk API key JWT yang tidak punya exp

v0.1.0 (2026-05-21)

TL;DR

Perubahan:

  • ✨ New: Rilis awal (High) — permission utilities + authenticated HTTP client untuk frontend sauth ecosystem

Impact: ✨ New: 1

Backward Compatible: ✅ Ya

✨ New

Rilis Awal — Permission Utilities + RequestInstance

Library menyediakan permission check di frontend (via Inertia PageProps atau JWT cookie) dan HTTP client (RequestInstance) yang otomatis mengurus service-token lifecycle untuk calls ke resource server — dua mode: session (Inertia/Breeze gateway) dan pkce (standalone SPA).

Poin utama:

  • permissionCheck / permissionCheckFromToken — wildcard + OR logic; mirror hasAnyPermission() dari sauth-client PHP
  • RequestInstance — dua mode, interceptor 401 retry sekali, subclassable via refreshingToken()
  • ServiceCodes — ecosystem invariants (GWA, GWC, WEBMASTER, CUSTOMER_ROLES)

Lihat: Quick Start | RequestInstance