Skip to content

Commit

Permalink
Merge pull request #150 from humhub/63-oauthexternal-auths-broken-goo…
Browse files Browse the repository at this point in the history
…gle-sign-in

Define known userAgent and NameForUserAgent
  • Loading branch information
luke- committed Jan 8, 2024
2 parents af64b28 + 6d26390 commit e3779b6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/components/auth_in_app_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ class AuthInAppBrowser extends InAppBrowser {
final Manifest manifest;
late InAppBrowserClassOptions options;
final Function concludeAuth;
static const String userAgent =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';

AuthInAppBrowser({required this.manifest, required this.concludeAuth}) {
options = InAppBrowserClassOptions(
crossPlatform: InAppBrowserOptions(hideUrlBar: false, toolbarTopBackgroundColor: HexColor(manifest.themeColor)),
crossPlatform: InAppBrowserOptions(
hideUrlBar: false,
toolbarTopBackgroundColor: HexColor(manifest.themeColor),
),
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(javaScriptEnabled: true, useShouldOverrideUrlLoading: true),
crossPlatform: InAppWebViewOptions(
javaScriptEnabled: true,
useShouldOverrideUrlLoading: true,
userAgent: userAgent,
applicationNameForUserAgent: 'HumHub-Mobile'),
),
);
}
Expand All @@ -32,6 +41,4 @@ class AuthInAppBrowser extends InAppBrowser {
launchUrl(URLRequest urlRequest) {
openUrlRequest(urlRequest: urlRequest, options: options);
}


}

0 comments on commit e3779b6

Please sign in to comment.