forked from baron/baron-sso
테넌트 접근 제한 안내화면 개선
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
// ignore_for_file: avoid_print
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -38,6 +40,19 @@ import 'i18n.dart';
|
||||
|
||||
final _log = Logger('Main');
|
||||
|
||||
Map<String, dynamic>? _decodeErrorDetails(String? raw) {
|
||||
if (raw == null || raw.trim().isEmpty) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
final decoded = jsonDecode(raw);
|
||||
if (decoded is Map<String, dynamic>) {
|
||||
return decoded;
|
||||
}
|
||||
} catch (_) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
void _attemptRecoveryFromNullCheck({
|
||||
required Object exception,
|
||||
StackTrace? stackTrace,
|
||||
@@ -398,6 +413,7 @@ final _router = GoRouter(
|
||||
errorCode: params['error'],
|
||||
description:
|
||||
params['error_description'] ?? params['message'],
|
||||
tenantAccessDetails: _decodeErrorDetails(params['details']),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user