saveOAuthTokensIfNeeded function
Save OAuth tokens if needed.
Implementation
({bool success, String? warning}) saveOAuthTokensIfNeeded(OAuthTokens tokens) {
if (!_shouldUseNeomageAIAuth(tokens.scopes)) {
return (success: true, warning: null);
}
if (tokens.refreshToken == null || tokens.expiresAt == null) {
return (success: true, warning: null);
}
// Placeholder: full implementation writes to secure storage.
_cachedOAuthTokens = tokens;
return (success: true, warning: null);
}