forked from baron/baron-sso
모바일 fallback 변경. .env유출 가능성 차단
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
const _compileTimeEnv = {
|
||||
'APP_ENV': String.fromEnvironment('APP_ENV'),
|
||||
'BACKEND_URL': String.fromEnvironment('BACKEND_URL'),
|
||||
'CLIENT_LOG_DEBUG': String.fromEnvironment('CLIENT_LOG_DEBUG'),
|
||||
'USERFRONT_DEBUG_LOG': String.fromEnvironment('USERFRONT_DEBUG_LOG'),
|
||||
'USERFRONT_URL': String.fromEnvironment('USERFRONT_URL'),
|
||||
};
|
||||
|
||||
String runtimeOriginFallback() {
|
||||
@@ -13,17 +13,10 @@ String runtimeOriginFallback() {
|
||||
return origin;
|
||||
}
|
||||
} catch (_) {}
|
||||
return 'https://sso-test.hmac.kr';
|
||||
return '';
|
||||
}
|
||||
|
||||
String envOrDefault(String key, String fallback) {
|
||||
if (dotenv.isInitialized) {
|
||||
final value = dotenv.env[key];
|
||||
if (value != null && value.trim().isNotEmpty) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
final compileTimeValue = _compileTimeEnv[key];
|
||||
if (compileTimeValue != null && compileTimeValue.trim().isNotEmpty) {
|
||||
return compileTimeValue;
|
||||
|
||||
Reference in New Issue
Block a user