forked from baron/baron-sso
테넌트 접근 제한 안내화면 개선
This commit is contained in:
@@ -396,8 +396,14 @@ class AuthProxyService {
|
||||
return jsonDecode(response.body);
|
||||
} else {
|
||||
final errorBody = jsonDecode(response.body);
|
||||
throw Exception(
|
||||
errorBody['error'] ?? tr('err.userfront.auth_proxy.consent_fetch'),
|
||||
final rawDetails = errorBody['details'];
|
||||
throw AuthProxyException(
|
||||
errorCode: (errorBody['code'] ?? '').toString(),
|
||||
message:
|
||||
(errorBody['error'] ??
|
||||
tr('err.userfront.auth_proxy.consent_fetch'))
|
||||
.toString(),
|
||||
details: rawDetails is Map<String, dynamic> ? rawDetails : null,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
@@ -1105,3 +1111,18 @@ class AuthProxyService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AuthProxyException implements Exception {
|
||||
final String errorCode;
|
||||
final String message;
|
||||
final Map<String, dynamic>? details;
|
||||
|
||||
const AuthProxyException({
|
||||
required this.errorCode,
|
||||
required this.message,
|
||||
this.details,
|
||||
});
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user