- SDK Version: 3.22.3
- Platform: Android Studio
-web3auth_flutter : ^5.0.3 - Browser Console Screenshots:
- If the issue is related to Custom Authentication, please include the following information (optional):
- Verifier Name:
- JWKS Endpoint:
- Sample idToken (JWT):
web_3_auth_initialization_bloc.dart :
import 'package:bloc/bloc.dart' show Bloc, Emitter;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:sky_ways/core/errors/failures/auth_failure.dart'
show Web3AuthInitializationFailure;
import 'package:sky_ways/features/auth/domain/repositories/auth_repository.dart';
part 'web_3_auth_initialization_event.dart';
part 'web_3_auth_initialization_state.dart';
part 'web_3_auth_initialization_bloc.freezed.dart';
class Web3AuthInitializationBloc
extends Bloc<Web3AuthInitializationEvent, Web3AuthInitializationState> {
Web3AuthInitializationBloc(
AuthRepository authRepository,
) : _authRepository = authRepository,
super(
const Web3AuthInitializationState.initial(),
) {
on<_Initialize>(
_initialize,
);
}
final AuthRepository _authRepository;
Future<void> _initialize(
_Initialize _,
Emitter<Web3AuthInitializationState> emit,
) async {
emit(
const Web3AuthInitializationState.initializing(),
);
final result = await _authRepository.initializeWeb3Auth();
result.fold(
(web3AuthInitializationFailure) => emit(
Web3AuthInitializationState.failedToInitialize(
web3AuthInitializationFailure: web3AuthInitializationFailure,
),
),
(_) => emit(
const Web3AuthInitializationState.initialized(),
),
);
}
}
web_3_auth_initialization_state.dart :
part of 'web_3_auth_initialization_bloc.dart';
@freezed
class Web3AuthInitializationState with _$Web3AuthInitializationState {
const factory Web3AuthInitializationState.initial() = _Initial;
const factory Web3AuthInitializationState.initializing() = _Initializing;
const factory Web3AuthInitializationState.initialized() = _Initialized;
const factory Web3AuthInitializationState.failedToInitialize({
required Web3AuthInitializationFailure web3AuthInitializationFailure,
}) = _FailedToInitialize;
}
web_3_auth_initialization_event.dart :
part of 'web_3_auth_initialization_bloc.dart';
@freezed
class Web3AuthInitializationEvent with _$Web3AuthInitializationEvent {
const factory Web3AuthInitializationEvent.initialize() = _Initialize;
}
While running the app, it freezes on the splash screen and the logs shows that the web3auth initialization failed. I have attached the screenshot of the logs for reference.