Sign in , out ,register.

This commit is contained in:
Burak Kaan Köse
2026-03-16 01:33:27 +01:00
parent 921c3bef93
commit 37c1bd3f62
35 changed files with 1195 additions and 30 deletions
@@ -0,0 +1,32 @@
using Wino.Core.Domain;
using Wino.Mail.Api.Contracts.Common;
namespace Wino.Mail.WinUI.Services;
public static class WinoAccountAuthErrorTranslator
{
public static string Translate(string? errorCode)
{
if (string.IsNullOrWhiteSpace(errorCode))
{
return Translator.GeneralTitle_Error;
}
return errorCode switch
{
ApiErrorCodes.InvalidCredentials => Translator.WinoAccount_Error_InvalidCredentials,
ApiErrorCodes.AccountLocked => Translator.WinoAccount_Error_AccountLocked,
ApiErrorCodes.AccountBanned => Translator.WinoAccount_Error_AccountBanned,
ApiErrorCodes.AccountSuspended => Translator.WinoAccount_Error_AccountSuspended,
ApiErrorCodes.RefreshTokenInvalid => Translator.WinoAccount_Error_RefreshTokenInvalid,
ApiErrorCodes.EmailAlreadyRegistered => Translator.WinoAccount_Error_EmailAlreadyRegistered,
ApiErrorCodes.ExternalLoginEmailRequired => Translator.WinoAccount_Error_ExternalLoginEmailRequired,
ApiErrorCodes.ExternalLoginInvalid => Translator.WinoAccount_Error_ExternalLoginInvalid,
ApiErrorCodes.ExternalAuthStateInvalid => Translator.WinoAccount_Error_ExternalAuthStateInvalid,
ApiErrorCodes.ExternalAuthCodeInvalid => Translator.WinoAccount_Error_ExternalAuthCodeInvalid,
ApiErrorCodes.Forbidden => Translator.WinoAccount_Error_Forbidden,
ApiErrorCodes.ValidationFailed => Translator.WinoAccount_Error_ValidationFailed,
_ => errorCode
};
}
}