mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
v1.1.1
Breaking changes: - Updated ArcaneAuthInterface to make the `resendVerificationCode`, `confirmSignup`, and `resetPassword` methods more versatile Signed-off-by: Hans Kokx <hans.kokx@hackberry.se>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
## 1.1.1
|
||||
|
||||
- [BREAKING] Updated ArcaneAuthInterface to make the `resendVerificationCode`, `confirmSignup`, and `resetPassword` methods more versatile
|
||||
|
||||
### Migration
|
||||
|
||||
| Class | Migration path |
|
||||
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ArcaneAuthInterface | `resendVerificationCode(String email)` -> `resendVerificationCode<T>({T? input})` |
|
||||
| ArcaneAuthInterface | `confirmSignup({String email, String password})` -> `confirmSignup({String? email, String? password})` |
|
||||
| ArcaneAuthInterface | `resetPassword({String email, String? newPassword, String? code})` -> `resetPassword({String? email, String? newPassword, String? code})` |
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- [BREAKING] Updated the authentication service and interface to be more versatile
|
||||
|
||||
@@ -53,8 +53,10 @@ class DebugAuthInterface implements ArcaneAuthInterface {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Result<String, String>> resendVerificationCode(String email) async {
|
||||
Arcane.log("Re-sending verification code to $email");
|
||||
Future<Result<String, String>> resendVerificationCode<T>({
|
||||
T? input,
|
||||
}) async {
|
||||
Arcane.log("Re-sending verification code to $input");
|
||||
return Result.ok("Code sent");
|
||||
}
|
||||
|
||||
@@ -76,8 +78,8 @@ class DebugAuthInterface implements ArcaneAuthInterface {
|
||||
|
||||
@override
|
||||
Future<Result<bool, String>> confirmSignup({
|
||||
required String username,
|
||||
required String confirmationCode,
|
||||
String? username,
|
||||
String? confirmationCode,
|
||||
}) async {
|
||||
Arcane.log(
|
||||
"Confirming registration for $username with code $confirmationCode",
|
||||
@@ -87,7 +89,7 @@ class DebugAuthInterface implements ArcaneAuthInterface {
|
||||
|
||||
@override
|
||||
Future<Result<bool, String>> resetPassword({
|
||||
required String email,
|
||||
String? email,
|
||||
String? newPassword,
|
||||
String? code,
|
||||
}) async {
|
||||
|
||||
@@ -60,9 +60,7 @@ abstract class ArcaneAuthInterface {
|
||||
/// This method is typically used when the user hasn't received or has lost their initial
|
||||
/// verification code. Returns a `Result` that contains the verification code on success
|
||||
/// or an error message.
|
||||
Future<Result<String, String>>? resendVerificationCode(
|
||||
String email,
|
||||
);
|
||||
Future<Result<String, String>>? resendVerificationCode<T>({T? input});
|
||||
|
||||
/// Registers a new account using user-supplied input.
|
||||
///
|
||||
@@ -83,8 +81,8 @@ abstract class ArcaneAuthInterface {
|
||||
/// This method completes the sign-up process by verifying the user's confirmation code.
|
||||
/// Returns a `Result` that contains `true` on success or an error message.
|
||||
Future<Result<bool, String>>? confirmSignup({
|
||||
required String username,
|
||||
required String confirmationCode,
|
||||
String? username,
|
||||
String? confirmationCode,
|
||||
});
|
||||
|
||||
/// Resets a user's password using an email address and a code.
|
||||
@@ -98,7 +96,7 @@ abstract class ArcaneAuthInterface {
|
||||
/// code or pin. The second call should include the `email`, the user's new password
|
||||
/// (`newPassword`), and the `code` they received in their email.
|
||||
Future<Result<bool, String>>? resetPassword({
|
||||
required String email,
|
||||
String? email,
|
||||
String? newPassword,
|
||||
String? code,
|
||||
});
|
||||
|
||||
@@ -252,7 +252,7 @@ class ArcaneAuthenticationService extends ArcaneService {
|
||||
}
|
||||
|
||||
final Future<Result<String, String>>? result =
|
||||
authInterface.resendVerificationCode(email);
|
||||
authInterface.resendVerificationCode(input: email);
|
||||
|
||||
if (result == null) {
|
||||
return Result.error(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: arcane_framework
|
||||
description: "Agnostic Reusable Component Architecture for New Ecosystems: a modern framework for bootstrapping new applications"
|
||||
version: 1.1.0
|
||||
version: 1.1.1
|
||||
repository: https://github.com/hanskokx/arcane_framework
|
||||
issue_tracker: https://github.com/hanskokx/arcane_framework/issues
|
||||
|
||||
|
||||
Reference in New Issue
Block a user