forked from gongxuegit/tiku-backend.net
feat: add local authentication
This commit is contained in:
18
Tiku.Application/Auth/AuthExceptions.cs
Normal file
18
Tiku.Application/Auth/AuthExceptions.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Tiku.Application.Auth;
|
||||
|
||||
public class AuthException(string code, string message) : Exception(message)
|
||||
{
|
||||
public string Code { get; } = code;
|
||||
}
|
||||
|
||||
public sealed class InvalidCredentialsException(string code = "invalid_credentials")
|
||||
: AuthException(code, "The supplied credentials are invalid.");
|
||||
|
||||
public sealed class TenantAccessDeniedException()
|
||||
: AuthException("tenant_access_denied", "The user is not an active member of the requested tenant.");
|
||||
|
||||
public sealed class SessionRevokedException()
|
||||
: AuthException("session_revoked", "The session has been revoked or expired.");
|
||||
|
||||
public sealed class SmsRateLimitedException()
|
||||
: AuthException("sms_rate_limited", "SMS verification requests are rate limited.");
|
||||
Reference in New Issue
Block a user