Forgot password and email confirmations.
This commit is contained in:
@@ -16,6 +16,8 @@ public interface IWinoAccountApiClient
|
||||
Task<WinoAccountApiResult<AuthResultDto>> RegisterAsync(string email, string password, CancellationToken cancellationToken = default);
|
||||
Task<WinoAccountApiResult<AuthResultDto>> LoginAsync(string email, string password, CancellationToken cancellationToken = default);
|
||||
Task<WinoAccountApiResult<AuthResultDto>> RefreshAsync(string refreshToken, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<EmailConfirmationResendResultDto>> ResendEmailConfirmationAsync(string endpoint, string ticket, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<JsonElement>> ForgotPasswordAsync(string email, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<JsonElement>> LogoutAsync(string refreshToken, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<AuthUserDto>> GetCurrentUserAsync(CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<AiStatusResultDto>> GetAiStatusAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
@@ -18,6 +19,8 @@ public interface IWinoAccountProfileService
|
||||
Task<WinoAccountOperationResult> LoginAsync(string email, string password, CancellationToken cancellationToken = default);
|
||||
Task<WinoAccountOperationResult> RefreshAsync(CancellationToken cancellationToken = default);
|
||||
Task<WinoAccountOperationResult> RefreshProfileAsync(CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<EmailConfirmationResendResultDto>> ResendEmailConfirmationAsync(string endpoint, string ticket, CancellationToken cancellationToken = default);
|
||||
Task<ApiEnvelope<JsonElement>> ForgotPasswordAsync(string email, CancellationToken cancellationToken = default);
|
||||
Task<WinoAccount?> GetActiveAccountAsync();
|
||||
Task<WinoAccount?> GetAuthenticatedAccountAsync(CancellationToken cancellationToken = default);
|
||||
Task<bool> HasActiveAccountAsync();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#nullable enable
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
@@ -7,6 +8,7 @@ public sealed class WinoAccountApiResult<T>
|
||||
public bool IsSuccess { get; init; }
|
||||
public string? ErrorCode { get; init; }
|
||||
public string? ErrorMessage { get; init; }
|
||||
public JsonElement? ErrorDetails { get; init; }
|
||||
public T? Result { get; init; }
|
||||
|
||||
public static WinoAccountApiResult<T> Success(T result)
|
||||
@@ -16,11 +18,12 @@ public sealed class WinoAccountApiResult<T>
|
||||
Result = result
|
||||
};
|
||||
|
||||
public static WinoAccountApiResult<T> Failure(string? errorCode, string? errorMessage = null)
|
||||
public static WinoAccountApiResult<T> Failure(string? errorCode, string? errorMessage = null, JsonElement? errorDetails = null)
|
||||
=> new()
|
||||
{
|
||||
IsSuccess = false,
|
||||
ErrorCode = errorCode,
|
||||
ErrorMessage = errorMessage
|
||||
ErrorMessage = errorMessage,
|
||||
ErrorDetails = errorDetails
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#nullable enable
|
||||
using System.Text.Json;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
@@ -8,6 +9,7 @@ public sealed class WinoAccountOperationResult
|
||||
public bool IsSuccess { get; init; }
|
||||
public string? ErrorCode { get; init; }
|
||||
public string? ErrorMessage { get; init; }
|
||||
public JsonElement? ErrorDetails { get; init; }
|
||||
public WinoAccount? Account { get; init; }
|
||||
|
||||
public static WinoAccountOperationResult Success(WinoAccount account)
|
||||
@@ -17,11 +19,12 @@ public sealed class WinoAccountOperationResult
|
||||
Account = account
|
||||
};
|
||||
|
||||
public static WinoAccountOperationResult Failure(string? errorCode, string? errorMessage = null)
|
||||
public static WinoAccountOperationResult Failure(string? errorCode, string? errorMessage = null, JsonElement? errorDetails = null)
|
||||
=> new()
|
||||
{
|
||||
IsSuccess = false,
|
||||
ErrorCode = errorCode,
|
||||
ErrorMessage = errorMessage
|
||||
ErrorMessage = errorMessage,
|
||||
ErrorDetails = errorDetails
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1238,10 +1238,15 @@
|
||||
"WinoAccount_LoginDialog_BenefitsDescription": "Use your Wino Account to continue syncing settings across devices and to access paid add-ons such as Wino AI Pack.",
|
||||
"WinoAccount_LoginDialog_DifferenceTitle": "This is not your email mailbox sign-in",
|
||||
"WinoAccount_LoginDialog_DifferenceDescription": "Signing in here does not add or replace your Outlook, Gmail, or IMAP accounts in Wino. It only signs you in to Wino-specific services.",
|
||||
"WinoAccount_LoginDialog_ForgotPasswordLink": "Forgot password?",
|
||||
"WinoAccount_EmailLabel": "Email",
|
||||
"WinoAccount_EmailPlaceholder": "name@example.com",
|
||||
"WinoAccount_PasswordLabel": "Password",
|
||||
"WinoAccount_ConfirmPasswordLabel": "Confirm password",
|
||||
"WinoAccount_ForgotPasswordDialog_Title": "Reset your password",
|
||||
"WinoAccount_ForgotPasswordDialog_PrimaryButton": "Send reset email",
|
||||
"WinoAccount_ForgotPasswordDialog_BackToSignIn": "Back to sign in",
|
||||
"WinoAccount_ForgotPasswordDialog_Description": "Enter your Wino Account email address and we will send you a password reset link if the address is registered.",
|
||||
"WinoAccount_Validation_EmailRequired": "Email is required.",
|
||||
"WinoAccount_Validation_PasswordRequired": "Password is required.",
|
||||
"WinoAccount_Validation_PasswordMismatch": "Passwords do not match.",
|
||||
@@ -1251,6 +1256,10 @@
|
||||
"WinoAccount_Error_AccountBanned": "This account has been banned.",
|
||||
"WinoAccount_Error_AccountSuspended": "This account has been suspended.",
|
||||
"WinoAccount_Error_EmailNotConfirmed": "Please confirm your email address before signing in.",
|
||||
"WinoAccount_Error_EmailConfirmationRequired": "Please confirm your email address before signing in.",
|
||||
"WinoAccount_Error_EmailConfirmationResendNotAvailable": "A new confirmation email is not available yet.",
|
||||
"WinoAccount_Error_EmailConfirmationResendInvalid": "This confirmation request is no longer valid. Please try signing in again.",
|
||||
"WinoAccount_Error_EmailNotRegistered": "This email address is not registered.",
|
||||
"WinoAccount_Error_RefreshTokenInvalid": "Your session is no longer valid. Please sign in again.",
|
||||
"WinoAccount_Error_EmailAlreadyRegistered": "This email address is already registered.",
|
||||
"WinoAccount_Error_ExternalLoginEmailRequired": "An email address is required to complete external sign-in.",
|
||||
@@ -1261,6 +1270,21 @@
|
||||
"WinoAccount_Error_ValidationFailed": "The request is invalid. Please review the entered values.",
|
||||
"WinoAccount_RegisterSuccessMessage": "Wino Account registration completed for {0}.",
|
||||
"WinoAccount_LoginSuccessMessage": "Signed in to Wino Account as {0}.",
|
||||
"WinoAccount_EmailConfirmationSentDialog_Title": "Confirm your email address",
|
||||
"WinoAccount_EmailConfirmationSentDialog_Message": "We sent an email confirmation to {0}. Please confirm it and try signing in again.",
|
||||
"WinoAccount_EmailConfirmationPendingDialog_Title": "Email confirmation required",
|
||||
"WinoAccount_EmailConfirmationPendingDialog_Message": "We are still waiting for you to confirm {0}.",
|
||||
"WinoAccount_EmailConfirmationPendingDialog_ResendButton": "Resend confirmation email",
|
||||
"WinoAccount_EmailConfirmationPendingDialog_Countdown": "You can resend the confirmation email in {0}.",
|
||||
"WinoAccount_EmailConfirmationPendingDialog_ReadyToResend": "You can resend the confirmation email now.",
|
||||
"WinoAccount_EmailConfirmationResentDialog_Title": "Confirmation email resent",
|
||||
"WinoAccount_EmailConfirmationResentDialog_Message": "We sent another confirmation email to {0}. Please confirm it and try signing in again.",
|
||||
"WinoAccount_ForgotPasswordDialog_SuccessTitle": "Password reset email sent",
|
||||
"WinoAccount_ForgotPasswordDialog_SuccessMessage": "We sent a password reset email to {0}. Open that message to choose a new password.",
|
||||
"WinoAccount_ChangePassword_Title": "Change password",
|
||||
"WinoAccount_ChangePassword_Description": "Send a password reset email to this Wino Account.",
|
||||
"WinoAccount_ChangePassword_Action": "Send reset email",
|
||||
"WinoAccount_ChangePassword_ConfirmationMessage": "Do you want Wino to send a password reset email to {0}?",
|
||||
"WinoAccount_SignOut_SuccessMessage": "Signed out from Wino Account {0}.",
|
||||
"WinoAccount_SignOut_NoAccountMessage": "There is no active Wino Account to sign out.",
|
||||
"WinoAccount_Titlebar_SignedOutTitle": "Wino Account",
|
||||
|
||||
Reference in New Issue
Block a user