EnakPoint & EnakCoin wallet, PIN, outlet, order, community, reward
- Wallet EnakPoint & EnakCoin: beranda, riwayat, saldo kedaluwarsa, kode bayar, tukar EnakCoin, transfer - PIN (buat, ganti, lupa), outlet, riwayat order, game spin - Halaman community, webview, coming soon, dan ikon menu beranda baru - Redesign Reward Saya: kartu tiket, filter chip, detail kode + QR - Hapus customer point loader, menu, dan checkout lama - Base URL ke enaklo-pos-api.altru.id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5954510b93
commit
f5e3075205
@@ -0,0 +1,32 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
/// Key untuk `Options.extra` yang menandai request berisi data rahasia
|
||||
/// (PIN, OTP). Request bertanda ini tidak dicetak ke log sama sekali.
|
||||
const String kSensitiveRequest = 'sensitive';
|
||||
|
||||
class SensitiveAwareLogInterceptor extends Interceptor {
|
||||
final Interceptor _logger;
|
||||
|
||||
SensitiveAwareLogInterceptor(this._logger);
|
||||
|
||||
bool _isSensitive(RequestOptions options) =>
|
||||
options.extra[kSensitiveRequest] == true;
|
||||
|
||||
@override
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||
if (_isSensitive(options)) return handler.next(options);
|
||||
_logger.onRequest(options, handler);
|
||||
}
|
||||
|
||||
@override
|
||||
void onResponse(Response response, ResponseInterceptorHandler handler) {
|
||||
if (_isSensitive(response.requestOptions)) return handler.next(response);
|
||||
_logger.onResponse(response, handler);
|
||||
}
|
||||
|
||||
@override
|
||||
void onError(DioException err, ErrorInterceptorHandler handler) {
|
||||
if (_isSensitive(err.requestOptions)) return handler.next(err);
|
||||
_logger.onError(err, handler);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user