mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -11,24 +11,14 @@ class OAuthService {
|
|||
final log = Logger('OAuthService');
|
||||
OAuthService(this._apiService);
|
||||
|
||||
Future<String?> getOAuthServerUrl(
|
||||
String serverUrl,
|
||||
String state,
|
||||
String codeChallenge,
|
||||
) async {
|
||||
Future<String?> getOAuthServerUrl(String serverUrl, String state, String codeChallenge) async {
|
||||
// Resolve API server endpoint from user provided serverUrl
|
||||
await _apiService.resolveAndSetEndpoint(serverUrl);
|
||||
final redirectUri = '$callbackUrlScheme:///oauth-callback';
|
||||
log.info(
|
||||
"Starting OAuth flow with redirect URI: $redirectUri",
|
||||
);
|
||||
log.info("Starting OAuth flow with redirect URI: $redirectUri");
|
||||
|
||||
final dto = await _apiService.oAuthApi.startOAuth(
|
||||
OAuthConfigDto(
|
||||
redirectUri: redirectUri,
|
||||
state: state,
|
||||
codeChallenge: codeChallenge,
|
||||
),
|
||||
OAuthConfigDto(redirectUri: redirectUri, state: state, codeChallenge: codeChallenge),
|
||||
);
|
||||
|
||||
final authUrl = dto?.url;
|
||||
|
|
@ -37,31 +27,17 @@ class OAuthService {
|
|||
return authUrl;
|
||||
}
|
||||
|
||||
Future<LoginResponseDto?> oAuthLogin(
|
||||
String oauthUrl,
|
||||
String state,
|
||||
String codeVerifier,
|
||||
) async {
|
||||
String result = await FlutterWebAuth2.authenticate(
|
||||
url: oauthUrl,
|
||||
callbackUrlScheme: callbackUrlScheme,
|
||||
);
|
||||
Future<LoginResponseDto?> oAuthLogin(String oauthUrl, String state, String codeVerifier) async {
|
||||
String result = await FlutterWebAuth2.authenticate(url: oauthUrl, callbackUrlScheme: callbackUrlScheme);
|
||||
|
||||
log.info('Received OAuth callback: $result');
|
||||
|
||||
if (result.startsWith('app.immich:/oauth-callback')) {
|
||||
result = result.replaceAll(
|
||||
'app.immich:/oauth-callback',
|
||||
'app.immich:///oauth-callback',
|
||||
);
|
||||
result = result.replaceAll('app.immich:/oauth-callback', 'app.immich:///oauth-callback');
|
||||
}
|
||||
|
||||
return await _apiService.oAuthApi.finishOAuth(
|
||||
OAuthCallbackDto(
|
||||
url: result,
|
||||
state: state,
|
||||
codeVerifier: codeVerifier,
|
||||
),
|
||||
OAuthCallbackDto(url: result, state: state, codeVerifier: codeVerifier),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue