New code verification service
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
17
frontend/pshared/lib/models/auth/login_outcome.dart
Normal file
17
frontend/pshared/lib/models/auth/login_outcome.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:pshared/models/account/account.dart';
|
||||
import 'package:pshared/models/auth/pending_login.dart';
|
||||
|
||||
|
||||
class LoginOutcome {
|
||||
final Account? account;
|
||||
final PendingLogin? pending;
|
||||
|
||||
const LoginOutcome._({this.account, this.pending});
|
||||
|
||||
factory LoginOutcome.completed(Account account) => LoginOutcome._(account: account);
|
||||
|
||||
factory LoginOutcome.pending(PendingLogin pending) => LoginOutcome._(pending: pending);
|
||||
|
||||
bool get isPending => pending != null;
|
||||
bool get isCompleted => account != null;
|
||||
}
|
||||
33
frontend/pshared/lib/models/auth/pending_login.dart
Normal file
33
frontend/pshared/lib/models/auth/pending_login.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:pshared/api/responses/login_pending.dart';
|
||||
import 'package:pshared/api/responses/token.dart';
|
||||
import 'package:pshared/data/mapper/account/account.dart';
|
||||
import 'package:pshared/models/account/account.dart';
|
||||
import 'package:pshared/models/session_identifier.dart';
|
||||
|
||||
|
||||
class PendingLogin {
|
||||
final Account account;
|
||||
final TokenData pendingToken;
|
||||
final String destination;
|
||||
final int ttlSeconds;
|
||||
final SessionIdentifier session;
|
||||
|
||||
const PendingLogin({
|
||||
required this.account,
|
||||
required this.pendingToken,
|
||||
required this.destination,
|
||||
required this.ttlSeconds,
|
||||
required this.session,
|
||||
});
|
||||
|
||||
factory PendingLogin.fromResponse(
|
||||
PendingLoginResponse response, {
|
||||
required SessionIdentifier session,
|
||||
}) => PendingLogin(
|
||||
account: response.account.account.toDomain(),
|
||||
pendingToken: response.pendingToken,
|
||||
destination: response.destination,
|
||||
ttlSeconds: response.ttlSeconds,
|
||||
session: session,
|
||||
);
|
||||
}
|
||||
18
frontend/pshared/lib/models/session_identifier.dart
Normal file
18
frontend/pshared/lib/models/session_identifier.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'session_identifier.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class SessionIdentifier {
|
||||
final String clientId;
|
||||
final String deviceId;
|
||||
|
||||
const SessionIdentifier({
|
||||
required this.clientId,
|
||||
required this.deviceId,
|
||||
});
|
||||
|
||||
factory SessionIdentifier.fromJson(Map<String, dynamic> json) => _$SessionIdentifierFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SessionIdentifierToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user