Skip to content

Commit

Permalink
Handle web flow (login & registration)
Browse files Browse the repository at this point in the history
  • Loading branch information
n-bernat committed Feb 3, 2025
1 parent a2043ef commit 80c5dd0
Show file tree
Hide file tree
Showing 17 changed files with 1,262 additions and 840 deletions.
576 changes: 353 additions & 223 deletions lib/src/common/api/auth_dtos.freezed.dart

Large diffs are not rendered by default.

57 changes: 31 additions & 26 deletions lib/src/common/api/auth_dtos.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 42 additions & 27 deletions lib/src/common/api/verification_flow_dto.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'verification_flow_dto.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

VerificationFlowDto _$VerificationFlowDtoFromJson(Map<String, dynamic> json) {
return _VerificationFlowDto.fromJson(json);
Expand All @@ -30,8 +30,12 @@ mixin _$VerificationFlowDto {
String get type => throw _privateConstructorUsedError;
UiDto get ui => throw _privateConstructorUsedError;

/// Serializes this VerificationFlowDto to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)

/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$VerificationFlowDtoCopyWith<VerificationFlowDto> get copyWith =>
throw _privateConstructorUsedError;
}
Expand Down Expand Up @@ -66,6 +70,8 @@ class _$VerificationFlowDtoCopyWithImpl<$Res, $Val extends VerificationFlowDto>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -119,6 +125,8 @@ class _$VerificationFlowDtoCopyWithImpl<$Res, $Val extends VerificationFlowDto>
) as $Val);
}

/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UiDtoCopyWith<$Res> get ui {
Expand All @@ -129,11 +137,11 @@ class _$VerificationFlowDtoCopyWithImpl<$Res, $Val extends VerificationFlowDto>
}

/// @nodoc
abstract class _$$_VerificationFlowDtoCopyWith<$Res>
abstract class _$$VerificationFlowDtoImplCopyWith<$Res>
implements $VerificationFlowDtoCopyWith<$Res> {
factory _$$_VerificationFlowDtoCopyWith(_$_VerificationFlowDto value,
$Res Function(_$_VerificationFlowDto) then) =
__$$_VerificationFlowDtoCopyWithImpl<$Res>;
factory _$$VerificationFlowDtoImplCopyWith(_$VerificationFlowDtoImpl value,
$Res Function(_$VerificationFlowDtoImpl) then) =
__$$VerificationFlowDtoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
Expand All @@ -152,13 +160,15 @@ abstract class _$$_VerificationFlowDtoCopyWith<$Res>
}

/// @nodoc
class __$$_VerificationFlowDtoCopyWithImpl<$Res>
extends _$VerificationFlowDtoCopyWithImpl<$Res, _$_VerificationFlowDto>
implements _$$_VerificationFlowDtoCopyWith<$Res> {
__$$_VerificationFlowDtoCopyWithImpl(_$_VerificationFlowDto _value,
$Res Function(_$_VerificationFlowDto) _then)
class __$$VerificationFlowDtoImplCopyWithImpl<$Res>
extends _$VerificationFlowDtoCopyWithImpl<$Res, _$VerificationFlowDtoImpl>
implements _$$VerificationFlowDtoImplCopyWith<$Res> {
__$$VerificationFlowDtoImplCopyWithImpl(_$VerificationFlowDtoImpl _value,
$Res Function(_$VerificationFlowDtoImpl) _then)
: super(_value, _then);

/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand All @@ -172,7 +182,7 @@ class __$$_VerificationFlowDtoCopyWithImpl<$Res>
Object? type = null,
Object? ui = null,
}) {
return _then(_$_VerificationFlowDto(
return _then(_$VerificationFlowDtoImpl(
active: freezed == active
? _value.active
: active // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -215,8 +225,8 @@ class __$$_VerificationFlowDtoCopyWithImpl<$Res>

/// @nodoc
@JsonSerializable()
class _$_VerificationFlowDto implements _VerificationFlowDto {
const _$_VerificationFlowDto(
class _$VerificationFlowDtoImpl implements _VerificationFlowDto {
const _$VerificationFlowDtoImpl(
{this.active,
this.expiresAt,
required this.id,
Expand All @@ -227,8 +237,8 @@ class _$_VerificationFlowDto implements _VerificationFlowDto {
required this.type,
required this.ui});

factory _$_VerificationFlowDto.fromJson(Map<String, dynamic> json) =>
_$$_VerificationFlowDtoFromJson(json);
factory _$VerificationFlowDtoImpl.fromJson(Map<String, dynamic> json) =>
_$$VerificationFlowDtoImplFromJson(json);

@override
final String? active;
Expand All @@ -255,10 +265,10 @@ class _$_VerificationFlowDto implements _VerificationFlowDto {
}

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$_VerificationFlowDto &&
other is _$VerificationFlowDtoImpl &&
(identical(other.active, active) || other.active == active) &&
(identical(other.expiresAt, expiresAt) ||
other.expiresAt == expiresAt) &&
Expand All @@ -274,21 +284,23 @@ class _$_VerificationFlowDto implements _VerificationFlowDto {
(identical(other.ui, ui) || other.ui == ui));
}

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, active, expiresAt, id, issuedAt,
requestUrl, returnTo, state, type, ui);

@JsonKey(ignore: true)
/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$_VerificationFlowDtoCopyWith<_$_VerificationFlowDto> get copyWith =>
__$$_VerificationFlowDtoCopyWithImpl<_$_VerificationFlowDto>(
_$$VerificationFlowDtoImplCopyWith<_$VerificationFlowDtoImpl> get copyWith =>
__$$VerificationFlowDtoImplCopyWithImpl<_$VerificationFlowDtoImpl>(
this, _$identity);

@override
Map<String, dynamic> toJson() {
return _$$_VerificationFlowDtoToJson(
return _$$VerificationFlowDtoImplToJson(
this,
);
}
Expand All @@ -304,10 +316,10 @@ abstract class _VerificationFlowDto implements VerificationFlowDto {
final String? returnTo,
required final String state,
required final String type,
required final UiDto ui}) = _$_VerificationFlowDto;
required final UiDto ui}) = _$VerificationFlowDtoImpl;

factory _VerificationFlowDto.fromJson(Map<String, dynamic> json) =
_$_VerificationFlowDto.fromJson;
_$VerificationFlowDtoImpl.fromJson;

@override
String? get active;
Expand All @@ -327,8 +339,11 @@ abstract class _VerificationFlowDto implements VerificationFlowDto {
String get type;
@override
UiDto get ui;

/// Create a copy of VerificationFlowDto
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
_$$_VerificationFlowDtoCopyWith<_$_VerificationFlowDto> get copyWith =>
@JsonKey(includeFromJson: false, includeToJson: false)
_$$VerificationFlowDtoImplCopyWith<_$VerificationFlowDtoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
8 changes: 4 additions & 4 deletions lib/src/common/api/verification_flow_dto.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 80c5dd0

Please sign in to comment.