From 00262e2a666276ec3f3f7cc09d4eb93af0b44333 Mon Sep 17 00:00:00 2001 From: Hassan Ben Jobrane Date: Tue, 26 Nov 2024 15:13:08 +0100 Subject: [PATCH 1/4] feat: add email OTP sign-in and verification methods (#150) * feat: add email OTP sign-in and verification methods * refactor: update verifyEmailOTP method signature to use named parameters --- .../nhost_auth_dart/lib/src/auth_client.dart | 53 +++++++++++++++++++ .../lib/src/base/hasura_auth_client.dart | 13 +++++ 2 files changed, 66 insertions(+) diff --git a/packages/nhost_auth_dart/lib/src/auth_client.dart b/packages/nhost_auth_dart/lib/src/auth_client.dart index 4fd6bd0f..63a73b55 100644 --- a/packages/nhost_auth_dart/lib/src/auth_client.dart +++ b/packages/nhost_auth_dart/lib/src/auth_client.dart @@ -379,6 +379,59 @@ class NhostAuthClient implements HasuraAuthClient { return res; } + /// Attempts to send an OTP to the specified [email] to begin the sign-in process + /// + /// Throws an [NhostException] if the request fails + @override + Future signInEmailOTP({ + required String email, + String? locale, + String? defaultRole, + Map? metadata, + List? roles, + String? displayName, + String? redirectTo, + }) async { + log.finer('Attempting sign in (otp)'); + + final includeRoleOptions = + defaultRole != null || (roles != null && roles.isNotEmpty); + final options = { + if (metadata != null) 'metadata': metadata, + if (locale != null) 'locale': locale, + if (includeRoleOptions) 'defaultRole': defaultRole, + if (includeRoleOptions) 'allowedRoles': roles, + if (displayName != null) 'displayName': displayName, + if (redirectTo != null) 'redirectTo': redirectTo, + }; + await _apiClient.post( + '/signin/otp/email', + jsonBody: { + 'email': email, + if (options.isNotEmpty) 'options': options, + }, + ); + } + + /// Attempts to verify the one-time password (OTP) and complete the sign-in process + /// + /// Throws an [NhostException] if verification fails + @override + Future verifyEmailOTP({ + required String email, + required String otp, + }) async { + final res = await _apiClient.post( + '/signin/otp/email/verify', + jsonBody: {'email': email, 'otp': otp}, + responseDeserializer: AuthResponse.fromJson, + ); + + log.finer('Sign in successful'); + await setSession(res.session!); + return res; + } + /// Attempts a sign in using the credentials stored in the [AuthStore] /// provided during construction. /// diff --git a/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart b/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart index 08737f75..03ee6228 100644 --- a/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart +++ b/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart @@ -63,6 +63,19 @@ abstract class HasuraAuthClient { String otp, ); + Future signInEmailOTP({ + required String email, + String? locale, + String? defaultRole, + Map? metadata, + List? roles, + String? displayName, + String? redirectTo, + }); + + Future verifyEmailOTP( + {required String email, required String otp}); + Future signInWithStoredCredentials(); Future signInWithRefreshToken(String refreshToken); From f2b2557fb5159c5eb107211e3be1cd75a0b8a68e Mon Sep 17 00:00:00 2001 From: Hassan Ben Jobrane Date: Tue, 26 Nov 2024 15:57:40 +0100 Subject: [PATCH 2/4] chore(release): Publish packages (#151) - nhost_auth_dart@2.3.0 - nhost_dart@2.0.6 - nhost_flutter_auth@4.0.6 - nhost_flutter_graphql@3.0.7 - nhost_functions_dart@2.0.6 - nhost_graphql_adapter@4.0.6 - nhost_sdk@5.4.0 - nhost_storage_dart@2.0.6 - nhost_gql_links@4.0.7 --- CHANGELOG.md | 65 +++++++++++++++++++ packages/nhost_auth_dart/CHANGELOG.md | 5 ++ packages/nhost_auth_dart/pubspec.yaml | 4 +- packages/nhost_dart/CHANGELOG.md | 4 ++ packages/nhost_dart/pubspec.yaml | 14 ++-- packages/nhost_flutter_auth/CHANGELOG.md | 4 ++ packages/nhost_flutter_auth/pubspec.yaml | 4 +- packages/nhost_flutter_graphql/CHANGELOG.md | 4 ++ packages/nhost_flutter_graphql/pubspec.yaml | 4 +- packages/nhost_functions_dart/CHANGELOG.md | 4 ++ packages/nhost_functions_dart/pubspec.yaml | 4 +- packages/nhost_gql_links/CHANGELOG.md | 4 ++ packages/nhost_gql_links/pubspec.yaml | 4 +- packages/nhost_graphql_adapter/CHANGELOG.md | 4 ++ .../example/pubspec.yaml | 2 +- packages/nhost_graphql_adapter/pubspec.yaml | 6 +- packages/nhost_sdk/CHANGELOG.md | 5 ++ packages/nhost_sdk/pubspec.yaml | 2 +- packages/nhost_storage_dart/CHANGELOG.md | 4 ++ .../nhost_storage_dart/example/pubspec.yaml | 2 +- packages/nhost_storage_dart/pubspec.yaml | 4 +- 21 files changed, 128 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 459bb6cf..53f289ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,71 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-11-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`nhost_auth_dart` - `v2.3.0`](#nhost_auth_dart---v230) + - [`nhost_dart` - `v2.0.6`](#nhost_dart---v206) + - [`nhost_flutter_auth` - `v4.0.6`](#nhost_flutter_auth---v406) + - [`nhost_flutter_graphql` - `v3.0.7`](#nhost_flutter_graphql---v307) + - [`nhost_functions_dart` - `v2.0.6`](#nhost_functions_dart---v206) + - [`nhost_graphql_adapter` - `v4.0.6`](#nhost_graphql_adapter---v406) + - [`nhost_sdk` - `v5.4.0`](#nhost_sdk---v540) + - [`nhost_storage_dart` - `v2.0.6`](#nhost_storage_dart---v206) + - [`nhost_gql_links` - `v4.0.7`](#nhost_gql_links---v407) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `nhost_gql_links` - `v4.0.7` + +--- + +#### `nhost_auth_dart` - `v2.3.0` + + - **REFACTOR**: remove unnecessary and unused files (#148). + - **FEAT**: add email OTP sign-in and verification methods (#150). + +#### `nhost_dart` - `v2.0.6` + + - **FIX**: test: add required parameter. + +#### `nhost_flutter_auth` - `v4.0.6` + + - **REFACTOR**: remove unnecessary and unused files (#148). + +#### `nhost_flutter_graphql` - `v3.0.7` + + - **REFACTOR**: remove unnecessary and unused files (#148). + +#### `nhost_functions_dart` - `v2.0.6` + + - **REFACTOR**: remove unnecessary and unused files (#148). + +#### `nhost_graphql_adapter` - `v4.0.6` + + - **REFACTOR**: remove unnecessary and unused files (#148). + +#### `nhost_sdk` - `v5.4.0` + + - **FIX**: handle null phoneNumber in User fromJson. + - **FEAT**: add email OTP sign-in and verification methods (#150). + +#### `nhost_storage_dart` - `v2.0.6` + + - **REFACTOR**: remove unnecessary and unused files (#148). + + ## 2024-07-19 ### Changes diff --git a/packages/nhost_auth_dart/CHANGELOG.md b/packages/nhost_auth_dart/CHANGELOG.md index abc74238..d691b634 100644 --- a/packages/nhost_auth_dart/CHANGELOG.md +++ b/packages/nhost_auth_dart/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0 + + - **REFACTOR**: remove unnecessary and unused files (#148). + - **FEAT**: add email OTP sign-in and verification methods (#150). + ## 2.2.1 - Update a dependency to the latest release. diff --git a/packages/nhost_auth_dart/pubspec.yaml b/packages/nhost_auth_dart/pubspec.yaml index 10729211..bffd9686 100644 --- a/packages/nhost_auth_dart/pubspec.yaml +++ b/packages/nhost_auth_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_auth_dart description: Nhost Dart Auth Service SDK -version: 2.2.1 +version: 2.3.0 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -14,7 +14,7 @@ dependencies: logging: ^1.1.0 meta: ^1.7.0 #Nhost_sdk - nhost_sdk: ^5.3.1 + nhost_sdk: ^5.4.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 diff --git a/packages/nhost_dart/CHANGELOG.md b/packages/nhost_dart/CHANGELOG.md index 69b0cecc..8e750da1 100644 --- a/packages/nhost_dart/CHANGELOG.md +++ b/packages/nhost_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + + - **FIX**: test: add required parameter. + ## 2.0.5 - **FIX**: test: add required parameter. diff --git a/packages/nhost_dart/pubspec.yaml b/packages/nhost_dart/pubspec.yaml index 02d3f416..94167050 100644 --- a/packages/nhost_dart/pubspec.yaml +++ b/packages/nhost_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_dart description: Nhost Dart SDK -version: 2.0.5 +version: 2.0.6 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -16,11 +16,11 @@ dependencies: path: ^1.8.0 #NHOST Package - nhost_sdk: ^5.3.1 - nhost_storage_dart: ^2.0.5 - nhost_auth_dart: ^2.2.1 - nhost_functions_dart: ^2.0.5 - nhost_graphql_adapter: ^4.0.5 + nhost_sdk: ^5.4.0 + nhost_storage_dart: ^2.0.6 + nhost_auth_dart: ^2.3.0 + nhost_functions_dart: ^2.0.6 + nhost_graphql_adapter: ^4.0.6 dev_dependencies: fake_async: ^1.3.1 graphql: ^5.1.3 @@ -33,7 +33,7 @@ dev_dependencies: test: ^1.22.0 gql: ^1.0.0 gql_exec: ^1.0.0 - nhost_gql_links: ^4.0.6 + nhost_gql_links: ^4.0.7 async: ^2.10.0 stream_channel: ^2.1.1 web_socket_channel: ^2.2.0 diff --git a/packages/nhost_flutter_auth/CHANGELOG.md b/packages/nhost_flutter_auth/CHANGELOG.md index b811026e..5df7e59a 100644 --- a/packages/nhost_flutter_auth/CHANGELOG.md +++ b/packages/nhost_flutter_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.6 + + - **REFACTOR**: remove unnecessary and unused files (#148). + ## 4.0.5 - Update a dependency to the latest release. diff --git a/packages/nhost_flutter_auth/pubspec.yaml b/packages/nhost_flutter_auth/pubspec.yaml index 840a4b9d..56c500a7 100644 --- a/packages/nhost_flutter_auth/pubspec.yaml +++ b/packages/nhost_flutter_auth/pubspec.yaml @@ -2,7 +2,7 @@ name: nhost_flutter_auth description: > Provides Nhost authentication state to your Flutter app, making it easy to set up protected resources, and react to sign ins and sign outs. -version: 4.0.5 +version: 4.0.6 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_flutter_auth issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -15,7 +15,7 @@ dependencies: flutter: sdk: flutter #Nhost_dart - nhost_dart: ^2.0.5 + nhost_dart: ^2.0.6 dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/nhost_flutter_graphql/CHANGELOG.md b/packages/nhost_flutter_graphql/CHANGELOG.md index d48bdcf8..2958e0d9 100644 --- a/packages/nhost_flutter_graphql/CHANGELOG.md +++ b/packages/nhost_flutter_graphql/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.7 + + - **REFACTOR**: remove unnecessary and unused files (#148). + ## 3.0.6 - Update a dependency to the latest release. diff --git a/packages/nhost_flutter_graphql/pubspec.yaml b/packages/nhost_flutter_graphql/pubspec.yaml index 99926f79..df9e1d62 100644 --- a/packages/nhost_flutter_graphql/pubspec.yaml +++ b/packages/nhost_flutter_graphql/pubspec.yaml @@ -2,7 +2,7 @@ name: nhost_flutter_graphql description: > Provides GraphQL clients to your Flutter application, automatically configured to work with Nhost -version: 3.0.6 +version: 3.0.7 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_flutter_graphql issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -18,7 +18,7 @@ dependencies: logging: ^1.1.0 #Nhost_dart - nhost_flutter_auth: ^4.0.5 + nhost_flutter_auth: ^4.0.6 dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/nhost_functions_dart/CHANGELOG.md b/packages/nhost_functions_dart/CHANGELOG.md index b2c4e666..93b44e5d 100644 --- a/packages/nhost_functions_dart/CHANGELOG.md +++ b/packages/nhost_functions_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + + - **REFACTOR**: remove unnecessary and unused files (#148). + ## 2.0.5 - Update a dependency to the latest release. diff --git a/packages/nhost_functions_dart/pubspec.yaml b/packages/nhost_functions_dart/pubspec.yaml index 6ecc1b3f..779afc33 100644 --- a/packages/nhost_functions_dart/pubspec.yaml +++ b/packages/nhost_functions_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_functions_dart description: Nhost Dart Functions Service SDK -version: 2.0.5 +version: 2.0.6 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -13,7 +13,7 @@ dependencies: http: ^1.1.0 logging: ^1.1.0 #Nhost_sdk - nhost_sdk: ^5.3.1 + nhost_sdk: ^5.4.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 diff --git a/packages/nhost_gql_links/CHANGELOG.md b/packages/nhost_gql_links/CHANGELOG.md index c14a3f50..b9255602 100644 --- a/packages/nhost_gql_links/CHANGELOG.md +++ b/packages/nhost_gql_links/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.7 + + - Update a dependency to the latest release. + ## 4.0.6 - Update a dependency to the latest release. diff --git a/packages/nhost_gql_links/pubspec.yaml b/packages/nhost_gql_links/pubspec.yaml index c9bb6cf8..459e2d1b 100644 --- a/packages/nhost_gql_links/pubspec.yaml +++ b/packages/nhost_gql_links/pubspec.yaml @@ -1,5 +1,5 @@ name: nhost_gql_links -version: 4.0.6 +version: 4.0.7 description: Constructs GraphQL links for use with graphql and ferry packages homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_gql_links @@ -20,7 +20,7 @@ dependencies: web_socket_channel: ^2.2.0 #Nhost_dart - nhost_sdk: ^5.3.1 + nhost_sdk: ^5.4.0 dev_dependencies: async: ^2.10.0 fake_async: ^1.3.1 diff --git a/packages/nhost_graphql_adapter/CHANGELOG.md b/packages/nhost_graphql_adapter/CHANGELOG.md index 98cfe888..b6ca0d1e 100644 --- a/packages/nhost_graphql_adapter/CHANGELOG.md +++ b/packages/nhost_graphql_adapter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.6 + + - **REFACTOR**: remove unnecessary and unused files (#148). + ## 4.0.5 - Update a dependency to the latest release. diff --git a/packages/nhost_graphql_adapter/example/pubspec.yaml b/packages/nhost_graphql_adapter/example/pubspec.yaml index 97bb586e..73e8e9b4 100644 --- a/packages/nhost_graphql_adapter/example/pubspec.yaml +++ b/packages/nhost_graphql_adapter/example/pubspec.yaml @@ -10,6 +10,6 @@ dependencies: graphql: ^5.1.3 # Nhost packages - nhost_dart: ^2.0.5 + nhost_dart: ^2.0.6 dev_dependencies: lints: any diff --git a/packages/nhost_graphql_adapter/pubspec.yaml b/packages/nhost_graphql_adapter/pubspec.yaml index 78468771..4f5cda3d 100644 --- a/packages/nhost_graphql_adapter/pubspec.yaml +++ b/packages/nhost_graphql_adapter/pubspec.yaml @@ -1,5 +1,5 @@ name: nhost_graphql_adapter -version: 4.0.5 +version: 4.0.6 description: Easily connect to your Nhost.io GraphQL backend using the graphql package. homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_graphql_adapter @@ -14,8 +14,8 @@ dependencies: meta: ^1.7.0 #Nhost_dart - nhost_gql_links: ^4.0.6 - nhost_sdk: ^5.3.1 + nhost_gql_links: ^4.0.7 + nhost_sdk: ^5.4.0 dev_dependencies: async: ^2.10.0 lints: any diff --git a/packages/nhost_sdk/CHANGELOG.md b/packages/nhost_sdk/CHANGELOG.md index 641e9907..da270ff0 100644 --- a/packages/nhost_sdk/CHANGELOG.md +++ b/packages/nhost_sdk/CHANGELOG.md @@ -1,3 +1,8 @@ +## 5.4.0 + + - **FIX**: handle null phoneNumber in User fromJson. + - **FEAT**: add email OTP sign-in and verification methods (#150). + ## 5.3.1 - **FIX**: handle null phoneNumber in User fromJson. diff --git a/packages/nhost_sdk/pubspec.yaml b/packages/nhost_sdk/pubspec.yaml index 86a867f9..5e601d46 100644 --- a/packages/nhost_sdk/pubspec.yaml +++ b/packages/nhost_sdk/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_sdk description: Nhost authentication and file storage/retrieval APIs for the Dart language. -version: 5.3.1 +version: 5.4.0 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues diff --git a/packages/nhost_storage_dart/CHANGELOG.md b/packages/nhost_storage_dart/CHANGELOG.md index 470e4f09..e109c1ca 100644 --- a/packages/nhost_storage_dart/CHANGELOG.md +++ b/packages/nhost_storage_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.6 + + - **REFACTOR**: remove unnecessary and unused files (#148). + ## 2.0.5 - Update a dependency to the latest release. diff --git a/packages/nhost_storage_dart/example/pubspec.yaml b/packages/nhost_storage_dart/example/pubspec.yaml index 74261dfc..62eca8f9 100644 --- a/packages/nhost_storage_dart/example/pubspec.yaml +++ b/packages/nhost_storage_dart/example/pubspec.yaml @@ -11,4 +11,4 @@ dependencies: # Nhost packages nhost_storage_dart: path: ../ - nhost_auth_dart: ^2.2.1 \ No newline at end of file + nhost_auth_dart: ^2.3.0 \ No newline at end of file diff --git a/packages/nhost_storage_dart/pubspec.yaml b/packages/nhost_storage_dart/pubspec.yaml index 7c86a7a1..985f68f4 100644 --- a/packages/nhost_storage_dart/pubspec.yaml +++ b/packages/nhost_storage_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_storage_dart description: Nhost Dart Storage Service SDK -version: 2.0.5 +version: 2.0.6 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -13,7 +13,7 @@ dependencies: http: ^1.1.0 #Nhost_sdk - nhost_sdk: ^5.3.1 + nhost_sdk: ^5.4.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 From d38e17b32a1ba6a33f7595bb1014213994b74778 Mon Sep 17 00:00:00 2001 From: Hassan Ben Jobrane Date: Thu, 28 Nov 2024 12:12:10 +0100 Subject: [PATCH 3/4] feat: add support for sign-in with id token (#149) * feat: add support for signin with id token * fix: remove mfa and add metdata options * feat: add linkIdToken method to HasuraAuthClient * fix dart linter error --- .../nhost_auth_dart/lib/src/auth_client.dart | 77 +++++++++++++++++++ .../lib/src/base/hasura_auth_client.dart | 6 ++ 2 files changed, 83 insertions(+) diff --git a/packages/nhost_auth_dart/lib/src/auth_client.dart b/packages/nhost_auth_dart/lib/src/auth_client.dart index 63a73b55..a621324e 100644 --- a/packages/nhost_auth_dart/lib/src/auth_client.dart +++ b/packages/nhost_auth_dart/lib/src/auth_client.dart @@ -263,6 +263,83 @@ class NhostAuthClient implements HasuraAuthClient { return res; } + /// Authenticates a user using an ID token from a third-party provider. + /// + /// This method allows users to sign in using an OpenID Connect [idToken] from a specified + /// [provider] (google, apple). An optional [nonce] parameter can be provided for additional security. + /// + /// Throws an [NhostException] if sign in fails. + @override + Future signInIdToken({ + required String provider, + required String idToken, + String? nonce, + String? locale, + String? defaultRole, + Map? metadata, + List? roles, + String? displayName, + String? redirectTo, + }) async { + log.finer('Attempting sign in (idToken)'); + AuthResponse? res; + + try { + res = await _apiClient.post( + '/signin/idtoken', + jsonBody: { + 'provider': provider, + 'idToken': idToken, + if (nonce != null) 'nonce': nonce, + if (locale != null) 'locale': locale, + if (defaultRole != null) 'defaultRole': defaultRole, + if (metadata != null) 'metadata': metadata, + if (roles != null) 'roles': roles, + if (displayName != null) 'displayName': displayName, + if (redirectTo != null) 'redirectTo': redirectTo, + }, + responseDeserializer: AuthResponse.fromJson, + ); + } catch (e, st) { + log.finer('Sign in failed', e, st); + await clearSession(); + rethrow; + } + + if (res != null) { + log.finer('Sign in successful'); + await setSession(res.session!); + return res; + } else { + throw AuthServiceException( + 'Sign in failed', + ); + } + } + + /// Links an existing user account to a third-party provider using an OpenID Connect [idToken]. + /// + /// This method enables linking a user account with an OpenID Connect [idToken] from a specified + /// [provider], such as "google" or "apple". You can optionally provide a [nonce] for enhanced security. + /// + /// Throws an [NhostException] if the link attempt fails. + @override + Future linkIdToken({ + required String provider, + required String idToken, + String? nonce, + }) async { + await _apiClient.post( + '/link/idtoken', + jsonBody: { + 'provider': provider, + 'idToken': idToken, + if (nonce != null) 'nonce': nonce, + }, + headers: _session.authenticationHeaders, + ); + } + /// Signs in a user with a magic link. /// /// An email will be sent to the [email] with a link. When the user diff --git a/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart b/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart index 03ee6228..3e54b0db 100644 --- a/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart +++ b/packages/nhost_sdk/lib/src/base/hasura_auth_client.dart @@ -38,6 +38,12 @@ abstract class HasuraAuthClient { required String password, }); + Future signInIdToken( + {required String provider, required String idToken, String? nonce}); + + Future linkIdToken( + {required String provider, required String idToken, String? nonce}); + Future signInWithEmailPasswordless( String email, { String? redirectTo, From 5fa2f6401ba915512f536e2a30ed3d3d631da902 Mon Sep 17 00:00:00 2001 From: Hassan Ben Jobrane Date: Thu, 28 Nov 2024 13:29:32 +0100 Subject: [PATCH 4/4] chore(release): Publish packages (#152) - nhost_auth_dart@2.4.0 - nhost_sdk@5.5.0 - nhost_dart@2.0.7 - nhost_flutter_auth@4.0.7 - nhost_flutter_graphql@3.0.8 - nhost_graphql_adapter@4.0.7 - nhost_storage_dart@2.0.7 - nhost_functions_dart@2.0.7 - nhost_gql_links@4.0.8 --- CHANGELOG.md | 45 +++++++++++++++++++ packages/nhost_auth_dart/CHANGELOG.md | 4 ++ packages/nhost_auth_dart/pubspec.yaml | 4 +- packages/nhost_dart/CHANGELOG.md | 4 ++ packages/nhost_dart/pubspec.yaml | 14 +++--- packages/nhost_flutter_auth/CHANGELOG.md | 4 ++ packages/nhost_flutter_auth/pubspec.yaml | 4 +- packages/nhost_flutter_graphql/CHANGELOG.md | 4 ++ packages/nhost_flutter_graphql/pubspec.yaml | 4 +- packages/nhost_functions_dart/CHANGELOG.md | 4 ++ packages/nhost_functions_dart/pubspec.yaml | 4 +- packages/nhost_gql_links/CHANGELOG.md | 4 ++ packages/nhost_gql_links/pubspec.yaml | 4 +- packages/nhost_graphql_adapter/CHANGELOG.md | 4 ++ .../example/pubspec.yaml | 2 +- packages/nhost_graphql_adapter/pubspec.yaml | 6 +-- packages/nhost_sdk/CHANGELOG.md | 4 ++ packages/nhost_sdk/pubspec.yaml | 2 +- packages/nhost_storage_dart/CHANGELOG.md | 4 ++ .../nhost_storage_dart/example/pubspec.yaml | 2 +- packages/nhost_storage_dart/pubspec.yaml | 4 +- 21 files changed, 106 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53f289ad..b25979cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,51 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-11-28 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`nhost_auth_dart` - `v2.4.0`](#nhost_auth_dart---v240) + - [`nhost_sdk` - `v5.5.0`](#nhost_sdk---v550) + - [`nhost_dart` - `v2.0.7`](#nhost_dart---v207) + - [`nhost_flutter_auth` - `v4.0.7`](#nhost_flutter_auth---v407) + - [`nhost_flutter_graphql` - `v3.0.8`](#nhost_flutter_graphql---v308) + - [`nhost_graphql_adapter` - `v4.0.7`](#nhost_graphql_adapter---v407) + - [`nhost_storage_dart` - `v2.0.7`](#nhost_storage_dart---v207) + - [`nhost_functions_dart` - `v2.0.7`](#nhost_functions_dart---v207) + - [`nhost_gql_links` - `v4.0.8`](#nhost_gql_links---v408) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `nhost_dart` - `v2.0.7` + - `nhost_flutter_auth` - `v4.0.7` + - `nhost_flutter_graphql` - `v3.0.8` + - `nhost_graphql_adapter` - `v4.0.7` + - `nhost_storage_dart` - `v2.0.7` + - `nhost_functions_dart` - `v2.0.7` + - `nhost_gql_links` - `v4.0.8` + +--- + +#### `nhost_auth_dart` - `v2.4.0` + + - **FEAT**: add support for sign-in with id token (#149). + +#### `nhost_sdk` - `v5.5.0` + + - **FEAT**: add support for sign-in with id token (#149). + + ## 2024-11-26 ### Changes diff --git a/packages/nhost_auth_dart/CHANGELOG.md b/packages/nhost_auth_dart/CHANGELOG.md index d691b634..fa44af0b 100644 --- a/packages/nhost_auth_dart/CHANGELOG.md +++ b/packages/nhost_auth_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.0 + + - **FEAT**: add support for sign-in with id token (#149). + ## 2.3.0 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_auth_dart/pubspec.yaml b/packages/nhost_auth_dart/pubspec.yaml index bffd9686..aa3b1d47 100644 --- a/packages/nhost_auth_dart/pubspec.yaml +++ b/packages/nhost_auth_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_auth_dart description: Nhost Dart Auth Service SDK -version: 2.3.0 +version: 2.4.0 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -14,7 +14,7 @@ dependencies: logging: ^1.1.0 meta: ^1.7.0 #Nhost_sdk - nhost_sdk: ^5.4.0 + nhost_sdk: ^5.5.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 diff --git a/packages/nhost_dart/CHANGELOG.md b/packages/nhost_dart/CHANGELOG.md index 8e750da1..65140826 100644 --- a/packages/nhost_dart/CHANGELOG.md +++ b/packages/nhost_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.7 + + - Update a dependency to the latest release. + ## 2.0.6 - **FIX**: test: add required parameter. diff --git a/packages/nhost_dart/pubspec.yaml b/packages/nhost_dart/pubspec.yaml index 94167050..f24bb69f 100644 --- a/packages/nhost_dart/pubspec.yaml +++ b/packages/nhost_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_dart description: Nhost Dart SDK -version: 2.0.6 +version: 2.0.7 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -16,11 +16,11 @@ dependencies: path: ^1.8.0 #NHOST Package - nhost_sdk: ^5.4.0 - nhost_storage_dart: ^2.0.6 - nhost_auth_dart: ^2.3.0 - nhost_functions_dart: ^2.0.6 - nhost_graphql_adapter: ^4.0.6 + nhost_sdk: ^5.5.0 + nhost_storage_dart: ^2.0.7 + nhost_auth_dart: ^2.4.0 + nhost_functions_dart: ^2.0.7 + nhost_graphql_adapter: ^4.0.7 dev_dependencies: fake_async: ^1.3.1 graphql: ^5.1.3 @@ -33,7 +33,7 @@ dev_dependencies: test: ^1.22.0 gql: ^1.0.0 gql_exec: ^1.0.0 - nhost_gql_links: ^4.0.7 + nhost_gql_links: ^4.0.8 async: ^2.10.0 stream_channel: ^2.1.1 web_socket_channel: ^2.2.0 diff --git a/packages/nhost_flutter_auth/CHANGELOG.md b/packages/nhost_flutter_auth/CHANGELOG.md index 5df7e59a..82085b00 100644 --- a/packages/nhost_flutter_auth/CHANGELOG.md +++ b/packages/nhost_flutter_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.7 + + - Update a dependency to the latest release. + ## 4.0.6 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_flutter_auth/pubspec.yaml b/packages/nhost_flutter_auth/pubspec.yaml index 56c500a7..b35c7fa8 100644 --- a/packages/nhost_flutter_auth/pubspec.yaml +++ b/packages/nhost_flutter_auth/pubspec.yaml @@ -2,7 +2,7 @@ name: nhost_flutter_auth description: > Provides Nhost authentication state to your Flutter app, making it easy to set up protected resources, and react to sign ins and sign outs. -version: 4.0.6 +version: 4.0.7 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_flutter_auth issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -15,7 +15,7 @@ dependencies: flutter: sdk: flutter #Nhost_dart - nhost_dart: ^2.0.6 + nhost_dart: ^2.0.7 dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/nhost_flutter_graphql/CHANGELOG.md b/packages/nhost_flutter_graphql/CHANGELOG.md index 2958e0d9..0baf71f3 100644 --- a/packages/nhost_flutter_graphql/CHANGELOG.md +++ b/packages/nhost_flutter_graphql/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.8 + + - Update a dependency to the latest release. + ## 3.0.7 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_flutter_graphql/pubspec.yaml b/packages/nhost_flutter_graphql/pubspec.yaml index df9e1d62..7f591d62 100644 --- a/packages/nhost_flutter_graphql/pubspec.yaml +++ b/packages/nhost_flutter_graphql/pubspec.yaml @@ -2,7 +2,7 @@ name: nhost_flutter_graphql description: > Provides GraphQL clients to your Flutter application, automatically configured to work with Nhost -version: 3.0.7 +version: 3.0.8 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_flutter_graphql issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -18,7 +18,7 @@ dependencies: logging: ^1.1.0 #Nhost_dart - nhost_flutter_auth: ^4.0.6 + nhost_flutter_auth: ^4.0.7 dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/nhost_functions_dart/CHANGELOG.md b/packages/nhost_functions_dart/CHANGELOG.md index 93b44e5d..b5e63a72 100644 --- a/packages/nhost_functions_dart/CHANGELOG.md +++ b/packages/nhost_functions_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.7 + + - Update a dependency to the latest release. + ## 2.0.6 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_functions_dart/pubspec.yaml b/packages/nhost_functions_dart/pubspec.yaml index 779afc33..b2e11ace 100644 --- a/packages/nhost_functions_dart/pubspec.yaml +++ b/packages/nhost_functions_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_functions_dart description: Nhost Dart Functions Service SDK -version: 2.0.6 +version: 2.0.7 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -13,7 +13,7 @@ dependencies: http: ^1.1.0 logging: ^1.1.0 #Nhost_sdk - nhost_sdk: ^5.4.0 + nhost_sdk: ^5.5.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 diff --git a/packages/nhost_gql_links/CHANGELOG.md b/packages/nhost_gql_links/CHANGELOG.md index b9255602..07161cce 100644 --- a/packages/nhost_gql_links/CHANGELOG.md +++ b/packages/nhost_gql_links/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.8 + + - Update a dependency to the latest release. + ## 4.0.7 - Update a dependency to the latest release. diff --git a/packages/nhost_gql_links/pubspec.yaml b/packages/nhost_gql_links/pubspec.yaml index 459e2d1b..38b6064d 100644 --- a/packages/nhost_gql_links/pubspec.yaml +++ b/packages/nhost_gql_links/pubspec.yaml @@ -1,5 +1,5 @@ name: nhost_gql_links -version: 4.0.7 +version: 4.0.8 description: Constructs GraphQL links for use with graphql and ferry packages homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_gql_links @@ -20,7 +20,7 @@ dependencies: web_socket_channel: ^2.2.0 #Nhost_dart - nhost_sdk: ^5.4.0 + nhost_sdk: ^5.5.0 dev_dependencies: async: ^2.10.0 fake_async: ^1.3.1 diff --git a/packages/nhost_graphql_adapter/CHANGELOG.md b/packages/nhost_graphql_adapter/CHANGELOG.md index b6ca0d1e..fe91ceaf 100644 --- a/packages/nhost_graphql_adapter/CHANGELOG.md +++ b/packages/nhost_graphql_adapter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.7 + + - Update a dependency to the latest release. + ## 4.0.6 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_graphql_adapter/example/pubspec.yaml b/packages/nhost_graphql_adapter/example/pubspec.yaml index 73e8e9b4..6950bcf2 100644 --- a/packages/nhost_graphql_adapter/example/pubspec.yaml +++ b/packages/nhost_graphql_adapter/example/pubspec.yaml @@ -10,6 +10,6 @@ dependencies: graphql: ^5.1.3 # Nhost packages - nhost_dart: ^2.0.6 + nhost_dart: ^2.0.7 dev_dependencies: lints: any diff --git a/packages/nhost_graphql_adapter/pubspec.yaml b/packages/nhost_graphql_adapter/pubspec.yaml index 4f5cda3d..b5e0b7fa 100644 --- a/packages/nhost_graphql_adapter/pubspec.yaml +++ b/packages/nhost_graphql_adapter/pubspec.yaml @@ -1,5 +1,5 @@ name: nhost_graphql_adapter -version: 4.0.6 +version: 4.0.7 description: Easily connect to your Nhost.io GraphQL backend using the graphql package. homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_graphql_adapter @@ -14,8 +14,8 @@ dependencies: meta: ^1.7.0 #Nhost_dart - nhost_gql_links: ^4.0.7 - nhost_sdk: ^5.4.0 + nhost_gql_links: ^4.0.8 + nhost_sdk: ^5.5.0 dev_dependencies: async: ^2.10.0 lints: any diff --git a/packages/nhost_sdk/CHANGELOG.md b/packages/nhost_sdk/CHANGELOG.md index da270ff0..00293071 100644 --- a/packages/nhost_sdk/CHANGELOG.md +++ b/packages/nhost_sdk/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.0 + + - **FEAT**: add support for sign-in with id token (#149). + ## 5.4.0 - **FIX**: handle null phoneNumber in User fromJson. diff --git a/packages/nhost_sdk/pubspec.yaml b/packages/nhost_sdk/pubspec.yaml index 5e601d46..1f7967af 100644 --- a/packages/nhost_sdk/pubspec.yaml +++ b/packages/nhost_sdk/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_sdk description: Nhost authentication and file storage/retrieval APIs for the Dart language. -version: 5.4.0 +version: 5.5.0 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues diff --git a/packages/nhost_storage_dart/CHANGELOG.md b/packages/nhost_storage_dart/CHANGELOG.md index e109c1ca..5c140aab 100644 --- a/packages/nhost_storage_dart/CHANGELOG.md +++ b/packages/nhost_storage_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.7 + + - Update a dependency to the latest release. + ## 2.0.6 - **REFACTOR**: remove unnecessary and unused files (#148). diff --git a/packages/nhost_storage_dart/example/pubspec.yaml b/packages/nhost_storage_dart/example/pubspec.yaml index 62eca8f9..fcff53b3 100644 --- a/packages/nhost_storage_dart/example/pubspec.yaml +++ b/packages/nhost_storage_dart/example/pubspec.yaml @@ -11,4 +11,4 @@ dependencies: # Nhost packages nhost_storage_dart: path: ../ - nhost_auth_dart: ^2.3.0 \ No newline at end of file + nhost_auth_dart: ^2.4.0 \ No newline at end of file diff --git a/packages/nhost_storage_dart/pubspec.yaml b/packages/nhost_storage_dart/pubspec.yaml index 985f68f4..305b764e 100644 --- a/packages/nhost_storage_dart/pubspec.yaml +++ b/packages/nhost_storage_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: nhost_storage_dart description: Nhost Dart Storage Service SDK -version: 2.0.6 +version: 2.0.7 homepage: https://nhost.io repository: https://github.com/nhost/nhost-dart/tree/main/packages/nhost_sdk issue_tracker: https://github.com/nhost/nhost-dart/issues @@ -13,7 +13,7 @@ dependencies: http: ^1.1.0 #Nhost_sdk - nhost_sdk: ^5.4.0 + nhost_sdk: ^5.5.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0