Skip to content

Commit fbe2a59

Browse files
committed
refactor(auth): 将认证回调域名从secrandom-online更新为secrandom-lite
1 parent 20df63e commit fbe2a59

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

lib/services/auth/auth_config.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,27 @@ class AuthConfig {
1616

1717
static const String authCallbackBridgeUrl = String.fromEnvironment(
1818
'SECTL_AUTH_CALLBACK_BRIDGE_URL',
19-
defaultValue: 'https://secrandom-online.sectl.top/auth_callback',
19+
defaultValue: 'https://secrandom-lite.sectl.top/auth_callback',
2020
);
2121

2222
static const String authCallbackWebUrl = String.fromEnvironment(
2323
'SECTL_AUTH_CALLBACK_WEB_URL',
24-
defaultValue: 'https://secrandom-online.sectl.top/auth_callback_web.html',
24+
defaultValue: 'https://secrandom-lite.sectl.top/auth_callback_web.html',
2525
);
2626

2727
static const String authCallbackAndroidUrl = String.fromEnvironment(
2828
'SECTL_AUTH_CALLBACK_ANDROID_URL',
29-
defaultValue:
30-
'https://secrandom-online.sectl.top/auth_callback_android.html',
29+
defaultValue: 'https://secrandom-lite.sectl.top/auth_callback_android.html',
3130
);
3231

3332
static const String authCallbackWindowsUrl = String.fromEnvironment(
3433
'SECTL_AUTH_CALLBACK_WINDOWS_URL',
35-
defaultValue:
36-
'https://secrandom-online.sectl.top/auth_callback_windows.html',
34+
defaultValue: 'https://secrandom-lite.sectl.top/auth_callback_windows.html',
3735
);
3836

3937
static const String webAppUrl = String.fromEnvironment(
4038
'SECTL_WEB_APP_URL',
41-
defaultValue: 'https://secrandom-online.sectl.top/',
39+
defaultValue: 'https://secrandom-lite.sectl.top/',
4240
);
4341

4442
static String get baseUrl =>
@@ -86,7 +84,7 @@ class AuthConfig {
8684
static String get oauthRedirectUri {
8785
if (useMockAuth &&
8886
authCallbackBridgeUrl ==
89-
'https://secrandom-online.sectl.top/auth_callback') {
87+
'https://secrandom-lite.sectl.top/auth_callback') {
9088
return '$mockAuthBaseUrl/auth_callback.html';
9189
}
9290
return authCallbackBridgeUrl;
@@ -95,7 +93,7 @@ class AuthConfig {
9593
static String get webOauthRedirectUri {
9694
if (useMockAuth &&
9795
authCallbackWebUrl ==
98-
'https://secrandom-online.sectl.top/auth_callback_web.html') {
96+
'https://secrandom-lite.sectl.top/auth_callback_web.html') {
9997
return '$mockAuthBaseUrl/auth_callback_web.html';
10098
}
10199
return authCallbackWebUrl;
@@ -104,7 +102,7 @@ class AuthConfig {
104102
static String get androidOauthRedirectUri {
105103
if (useMockAuth &&
106104
authCallbackAndroidUrl ==
107-
'https://secrandom-online.sectl.top/auth_callback_android.html') {
105+
'https://secrandom-lite.sectl.top/auth_callback_android.html') {
108106
return '$mockAuthBaseUrl/auth_callback_android.html';
109107
}
110108
return authCallbackAndroidUrl;
@@ -113,7 +111,7 @@ class AuthConfig {
113111
static String get windowsOauthRedirectUri {
114112
if (useMockAuth &&
115113
authCallbackWindowsUrl ==
116-
'https://secrandom-online.sectl.top/auth_callback_windows.html') {
114+
'https://secrandom-lite.sectl.top/auth_callback_windows.html') {
117115
return '$mockAuthBaseUrl/auth_callback_windows.html';
118116
}
119117
return authCallbackWindowsUrl;

test/pending_auth_session_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main() {
88
codeVerifier: 'verifier-token',
99
targetPlatform: PendingAuthTargetPlatform.windows,
1010
redirectUri:
11-
'https://secrandom-online.sectl.top/auth_callback_windows.html',
11+
'https://secrandom-lite.sectl.top/auth_callback_windows.html',
1212
loopbackPort: 8788,
1313
createdAt: DateTime.parse('2026-04-05T10:00:00.000Z'),
1414
);

test/sectl_auth_service_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main() {
4545
);
4646
expect(
4747
url.queryParameters['redirect_uri'],
48-
'https://secrandom-online.sectl.top/auth_callback_web.html',
48+
'https://secrandom-lite.sectl.top/auth_callback_web.html',
4949
);
5050
});
5151

@@ -216,14 +216,14 @@ void main() {
216216

217217
test('trusted web callback URI only accepts configured app origin', () {
218218
final trustedUri = parseTrustedWebAppCallbackUri(
219-
'https://secrandom-online.sectl.top/?code=abc&state=state-123#ignored',
219+
'https://secrandom-lite.sectl.top/?code=abc&state=state-123#ignored',
220220
);
221221
final untrustedUri = parseTrustedWebAppCallbackUri(
222222
'https://evil.example/?code=abc&state=state-123',
223223
);
224224

225225
expect(trustedUri, isNotNull);
226-
expect(trustedUri?.origin, 'https://secrandom-online.sectl.top');
226+
expect(trustedUri?.origin, 'https://secrandom-lite.sectl.top');
227227
expect(trustedUri?.fragment, isEmpty);
228228
expect(untrustedUri, isNull);
229229
});
@@ -232,7 +232,7 @@ void main() {
232232
'trusted web callback URI rejects credential-bearing redirect URLs',
233233
() {
234234
final uri = parseTrustedWebAppCallbackUri(
235-
'https://user:pass@secrandom-online.sectl.top/?code=abc',
235+
'https://user:pass@secrandom-lite.sectl.top/?code=abc',
236236
);
237237

238238
expect(uri, isNull);
@@ -246,8 +246,8 @@ void main() {
246246
isTrustedWebPopupCallbackMessage(
247247
messageType: 'sectl-auth-callback',
248248
href:
249-
'https://secrandom-online.sectl.top/?code=abc&state=state-123',
250-
eventOrigin: 'https://secrandom-online.sectl.top',
249+
'https://secrandom-lite.sectl.top/?code=abc&state=state-123',
250+
eventOrigin: 'https://secrandom-lite.sectl.top',
251251
isFromExpectedPopupWindow: true,
252252
),
253253
isTrue,
@@ -257,7 +257,7 @@ void main() {
257257
isTrustedWebPopupCallbackMessage(
258258
messageType: 'sectl-auth-callback',
259259
href:
260-
'https://secrandom-online.sectl.top/?code=abc&state=state-123',
260+
'https://secrandom-lite.sectl.top/?code=abc&state=state-123',
261261
eventOrigin: 'https://evil.example',
262262
isFromExpectedPopupWindow: true,
263263
),
@@ -268,8 +268,8 @@ void main() {
268268
isTrustedWebPopupCallbackMessage(
269269
messageType: 'sectl-auth-callback',
270270
href:
271-
'https://secrandom-online.sectl.top/?code=abc&state=state-123',
272-
eventOrigin: 'https://secrandom-online.sectl.top',
271+
'https://secrandom-lite.sectl.top/?code=abc&state=state-123',
272+
eventOrigin: 'https://secrandom-lite.sectl.top',
273273
isFromExpectedPopupWindow: false,
274274
),
275275
isFalse,

0 commit comments

Comments
 (0)