From 52c6626531ef4f917282da76a421ad6ad859137b Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Fri, 20 Sep 2024 15:23:13 +0200 Subject: [PATCH] v1.0.5+1 - Marks `loginWithEmailAndPassword` as deprecated and update example Signed-off-by: Hans Kokx --- CHANGELOG.md | 4 ++++ example/lib/interfaces/debug_auth_interface.dart | 15 +++------------ example/lib/main.dart | 8 +++++--- .../authentication/authentication_interface.dart | 1 + .../authentication/authentication_service.dart | 1 + pubspec.yaml | 2 +- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcbf811..056bd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5+1 + +- Marked the `loginWithEmailAndPassword` method in ArcaneAuthenticationService as deprecated and updated example project + ## 1.0.5 - Added the ability to use a generic type for the login method in ArcaneAuthenticationService diff --git a/example/lib/interfaces/debug_auth_interface.dart b/example/lib/interfaces/debug_auth_interface.dart index 60434ec..9536bc1 100644 --- a/example/lib/interfaces/debug_auth_interface.dart +++ b/example/lib/interfaces/debug_auth_interface.dart @@ -33,17 +33,8 @@ class DebugAuthInterface implements ArcaneAuthInterface { Future> loginWithEmailAndPassword({ required String email, required String password, - }) async { - final bool alreadyLoggedIn = await isSignedIn; - - if (alreadyLoggedIn) return Result.ok(null); - - Arcane.log("Logging in as $email"); - - _isSignedIn = true; - - return Result.ok(null); - } + }) async => + throw UnimplementedError(); @override Future> login({ @@ -54,7 +45,7 @@ class DebugAuthInterface implements ArcaneAuthInterface { if (alreadyLoggedIn) return Result.ok(null); - Arcane.log("Logging: $input"); + Arcane.log("Logging in with input: $input"); _isSignedIn = true; diff --git a/example/lib/main.dart b/example/lib/main.dart index ea8eced..565ba60 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -116,9 +116,11 @@ class _HomeScreenState extends State { ElevatedButton( child: const Text("Sign in"), onPressed: () async { - await Arcane.auth.loginWithEmailAndPassword( - email: "email", - password: "password", + await Arcane.auth.login>( + input: { + "email": "email", + "password": "password", + }, onLoggedIn: () async { setState(() {}); }, diff --git a/lib/src/services/authentication/authentication_interface.dart b/lib/src/services/authentication/authentication_interface.dart index 6745a13..a8d22c0 100644 --- a/lib/src/services/authentication/authentication_interface.dart +++ b/lib/src/services/authentication/authentication_interface.dart @@ -46,6 +46,7 @@ abstract class ArcaneAuthInterface { /// password: "password123", /// ); /// ``` + @Deprecated("Use `login` instead. Deprecated as of version 1.0.5") Future> loginWithEmailAndPassword({ required String email, required String password, diff --git a/lib/src/services/authentication/authentication_service.dart b/lib/src/services/authentication/authentication_service.dart index 4b5fd64..1ca166a 100644 --- a/lib/src/services/authentication/authentication_service.dart +++ b/lib/src/services/authentication/authentication_service.dart @@ -180,6 +180,7 @@ class ArcaneAuthenticationService extends ArcaneService { /// method will run after the authentication status has been updated. /// When logging in with email and password, the user's email address will be /// cached in `ArcaneSecureStorage`. + @Deprecated("Use `login` instead. Deprecated as of version 1.0.5") Future> loginWithEmailAndPassword({ required String email, required String password, diff --git a/pubspec.yaml b/pubspec.yaml index 94c9651..e1da7b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: arcane_framework description: "Agnostic Reusable Component Architecture for New Ecosystems: a modern framework for bootstrapping new applications" -version: 1.0.5 +version: 1.0.5+1 repository: https://github.com/hanskokx/arcane_framework issue_tracker: https://github.com/hanskokx/arcane_framework/issues