Skip to content

Commit

Permalink
feat: set User-Agent in webview to fix Google signin failure (#38)
Browse files Browse the repository at this point in the history
* add useragent to webview

* Update casdoor_flutter_sdk_mobile.dart

---------

Co-authored-by: Eric Luo <[email protected]>
  • Loading branch information
heralight and hsluoyz authored Mar 10, 2024
1 parent 96f70f8 commit 62efb1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/casdoor_flutter_sdk_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class _FullScreenAuthPageState extends State<FullScreenAuthPage> {
initialUrlRequest: URLRequest(url: Uri.parse(widget.params.url)),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
userAgent:
"Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0",
clearCache: widget.params.clearCache!,
useShouldOverrideUrlLoading: true,
useOnLoadResource: true,
Expand Down Expand Up @@ -209,6 +211,8 @@ class CasdoorFlutterSdkMobile extends CasdoorFlutterSdkPlatform {
options: InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
userAgent:
"Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0",
clearCache: params.clearCache!,
useOnLoadResource: true,
useShouldOverrideUrlLoading: true,
Expand Down

0 comments on commit 62efb1e

Please sign in to comment.