Skip to content

Commit

Permalink
Bump version, add changelog and add/update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 7, 2024
1 parent 31e9074 commit 9710fc8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
4 changes: 4 additions & 0 deletions flutter_web_auth_2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.0.0-alpha.0

- 🎉 Add Webview approach for Windows and Linux (Thanks to [@Mino5531](https://github.com/Mino5531) in [#92](https://github.com/ThexXTURBOXx/flutter_web_auth_2/pull/92))

## 3.1.1

- 🐛 Fix null-safe options (again)
Expand Down
28 changes: 25 additions & 3 deletions flutter_web_auth_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add the following snippet to your `pubspec.yaml` and follow the [Setup guide](#s

```yaml
dependencies:
flutter_web_auth_2: ^3.0.0
flutter_web_auth_2: ^4.0.0-alpha.0
```
To authenticate against your own custom site:
Expand Down Expand Up @@ -82,6 +82,26 @@ final accessToken = jsonDecode(response.body)['access_token'] as String;

**Note:** To use multiple scopes with Google, you need to encode them as a single string, separated by spaces. For example, `scope: 'email https://www.googleapis.com/auth/userinfo.profile'`. Here is [a list of all supported scopes](https://developers.google.com/identity/protocols/oauth2/scopes).

## Upgrading to `4.x`

Version `4.0.0` introduced a new approach for Linux and Windows to authenticate users - using
Webview APIs. Hence, you only need to change your code if you are targeting Linux or Windows.
If you are fine with still using the old version, here is what you need to change:
- Pass `useWebview: false` into the options of your call to `authenticate`, like so:
```dart
final result = await FlutterWebAuth2.authenticate(
url: url,
callbackUrlScheme: 'foobar',
options: const FlutterWebAuth2Options(useWebview: false),
);
```

If you want to use the new approach (**default behaviour!**), you need to do a bit more:
- Follow the "Getting started" guide of
[desktop_webview_window](https://pub.dev/packages/desktop_webview_window#getting-started)
- Make sure that your users know about the new requirements, as described
[here](https://pub.dev/packages/desktop_webview_window)

## Upgrading to `3.x`

Version `3.0.0` featured a huge refactor which made it possible to maintain even more configuration
Expand Down Expand Up @@ -188,9 +208,11 @@ Additional parameters for the URL open call can be passed in the `authenticate`

### Windows and Linux

There is still a limitation that the callback URL scheme must start with `http://localhost:{port}`.
When using `useWebview: false`, there is a limitation that the callback URL scheme must start with `http://localhost:{port}`.

If you have any experience in removing this limitation, please let me know!
When specifying `useWebview: true` (which is the default behaviour), you need to make sure to follow [desktop_webview_window's guide](https://pub.dev/packages/desktop_webview_window).
Also be aware that your users might need to install a Webview API (which is preinstalled on Windows 11 and some Windows 10 and Linux installations).
For details, see also desktop_webview_window's guide above.

## Troubleshooting

Expand Down
4 changes: 2 additions & 2 deletions flutter_web_auth_2/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_web_auth_2
description: Flutter plugin for authenticating a user with a web service.
version: 3.1.1
version: 4.0.0-alpha.0
homepage: https://github.com/ThexXTURBOXx/flutter_web_auth_2
repository: https://github.com/ThexXTURBOXx/flutter_web_auth_2
issue_tracker: https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues
Expand All @@ -27,7 +27,7 @@ dependencies:
desktop_webview_window: ^0.2.3
flutter:
sdk: flutter
flutter_web_auth_2_platform_interface: ^3.0.0
flutter_web_auth_2_platform_interface: ^4.0.0-alpha.0
flutter_web_plugins:
sdk: flutter
path_provider: ^2.1.2
Expand Down
4 changes: 4 additions & 0 deletions flutter_web_auth_2_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.0.0-alpha.0

- 🌹 Update to new major version in conjunction with main package

## 3.1.0

- 🌹 Fix lint for Flutter 3.16.x
Expand Down
2 changes: 1 addition & 1 deletion flutter_web_auth_2_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_web_auth_2_platform_interface
description: A common platform interface for the flutter_web_auth_2 plugin.
version: 3.1.0
version: 4.0.0-alpha.0
homepage: https://github.com/ThexXTURBOXx/flutter_web_auth_2
repository: https://github.com/ThexXTURBOXx/flutter_web_auth_2
issue_tracker: https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues
Expand Down

0 comments on commit 9710fc8

Please sign in to comment.