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