mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
Formatted files
This commit is contained in:
@@ -14,7 +14,8 @@ part "authentication_interface.dart";
|
|||||||
class ArcaneAuthenticationService extends ArcaneService {
|
class ArcaneAuthenticationService extends ArcaneService {
|
||||||
ArcaneAuthenticationService._internal();
|
ArcaneAuthenticationService._internal();
|
||||||
|
|
||||||
static final ArcaneAuthenticationService _instance = ArcaneAuthenticationService._internal();
|
static final ArcaneAuthenticationService _instance =
|
||||||
|
ArcaneAuthenticationService._internal();
|
||||||
|
|
||||||
/// Provides access to the singleton instance of this service.
|
/// Provides access to the singleton instance of this service.
|
||||||
static ArcaneAuthenticationService get I => _instance;
|
static ArcaneAuthenticationService get I => _instance;
|
||||||
@@ -50,11 +51,13 @@ class ArcaneAuthenticationService extends ArcaneService {
|
|||||||
/// Returns a JWT access token if the registered `ArcaneAuthInterface`
|
/// Returns a JWT access token if the registered `ArcaneAuthInterface`
|
||||||
/// provides one. This token is often used in the headers of HTTP requests
|
/// provides one. This token is often used in the headers of HTTP requests
|
||||||
/// to the backend API.
|
/// to the backend API.
|
||||||
Future<String?> get accessToken => authInterface?.accessToken ?? Future.value("");
|
Future<String?> get accessToken =>
|
||||||
|
authInterface?.accessToken ?? Future.value("");
|
||||||
|
|
||||||
/// Returns a JWT refresh token if the registered `ArcaneAuthInterface`
|
/// Returns a JWT refresh token if the registered `ArcaneAuthInterface`
|
||||||
/// provides one.
|
/// provides one.
|
||||||
Future<String?> get refreshToken => authInterface?.refreshToken ?? Future.value("");
|
Future<String?> get refreshToken =>
|
||||||
|
authInterface?.refreshToken ?? Future.value("");
|
||||||
|
|
||||||
/// Removes any registered `ArcaneAuthInterface` and resets all values to
|
/// Removes any registered `ArcaneAuthInterface` and resets all values to
|
||||||
/// default.
|
/// default.
|
||||||
@@ -273,7 +276,8 @@ class ArcaneAuthenticationService extends ArcaneService {
|
|||||||
|
|
||||||
final auth = authInterface as ArcaneAuthAccountRegistration;
|
final auth = authInterface as ArcaneAuthAccountRegistration;
|
||||||
|
|
||||||
final Future<Result<String, String>>? result = auth.resendVerificationCode(input: email);
|
final Future<Result<String, String>>? result =
|
||||||
|
auth.resendVerificationCode(input: email);
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
return Result.error(
|
return Result.error(
|
||||||
|
|||||||
@@ -132,8 +132,12 @@ class ArcaneLogger {
|
|||||||
metadata.putIfAbsent("timestamp", () => now);
|
metadata.putIfAbsent("timestamp", () => now);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final List<String> parts =
|
final List<String> parts = StackTrace.current
|
||||||
StackTrace.current.toString().split("\n")[2].split(RegExp("#2"))[1].trimLeft().split(".");
|
.toString()
|
||||||
|
.split("\n")[2]
|
||||||
|
.split(RegExp("#2"))[1]
|
||||||
|
.trimLeft()
|
||||||
|
.split(".");
|
||||||
|
|
||||||
module ??= parts.first.replaceFirst("new ", "");
|
module ??= parts.first.replaceFirst("new ", "");
|
||||||
method ??= parts[1].split(" ").first.replaceAll("<anonymous", "");
|
method ??= parts[1].split(" ").first.replaceAll("<anonymous", "");
|
||||||
@@ -147,10 +151,12 @@ class ArcaneLogger {
|
|||||||
.last
|
.last
|
||||||
.split(":");
|
.split(":");
|
||||||
|
|
||||||
final String fileAndLine = "${fileAndLineParts[0]}:${fileAndLineParts[1]}";
|
final String fileAndLine =
|
||||||
|
"${fileAndLineParts[0]}:${fileAndLineParts[1]}";
|
||||||
|
|
||||||
metadata.putIfAbsent("module", () => module!);
|
metadata.putIfAbsent("module", () => module!);
|
||||||
if (method.isNotNullOrEmpty) metadata.putIfAbsent("method", () => method!);
|
if (method.isNotNullOrEmpty)
|
||||||
|
metadata.putIfAbsent("method", () => method!);
|
||||||
metadata.putIfAbsent("filenameAndLineNumber", () => fileAndLine);
|
metadata.putIfAbsent("filenameAndLineNumber", () => fileAndLine);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user