implemented auth repository and service in dart (JWT)

This commit is contained in:
2025-01-03 22:28:25 +00:00
parent 6cf055db22
commit 05fdefc3e2
45 changed files with 868 additions and 46 deletions
@@ -1,4 +1,4 @@
import 'package:backend_dart/domain/interface/error.dart';
import 'package:backend_dart/domain/errors/error.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'error_code.dart';
@@ -48,4 +48,8 @@ class AppError with _$AppError implements IError {
factory AppError.inputError({String? message}) {
return AppError.fromErrorCode(ErrorCode.inputError, message: message);
}
factory AppError.authenticationError({String? message}) {
return AppError.fromErrorCode(ErrorCode.authenticationError, message: message);
}
}
@@ -0,0 +1,8 @@
import 'package:backend_dart/domain/errors/error_code.dart';
abstract class IError {
ErrorCode get code; // Fehlercode
String get message; // Fehlermeldung
StackTrace? get stackTrace; // Stacktrace
Map<String, String>? get details; // Zusätzliche Details
}
@@ -3,6 +3,7 @@ enum ErrorCode {
validationError, // Eingabevalidierungsfehler
unexpectedError, // Unerwarteter Fehler
authenticationError, // Authentifizierungsfehler
authorizationError, // Autorisierungsfehler
permissionDenied, // Berechtigungsfehler
notFound, // Ressource nicht gefunden
exception, // Ausnahme