CognitoUser constructor
CognitoUser(
- String? username,
- CognitoUserPool pool, {
- dynamic clientSecret,
- CognitoStorage? storage,
- String? deviceName = 'Dart-device',
- dynamic signInUserSession,
- ParamsDecorator? analyticsMetadataParamsDecorator,
Implementation
CognitoUser(
this.username,
this.pool, {
clientSecret,
CognitoStorage? storage,
this.deviceName = 'Dart-device',
signInUserSession,
ParamsDecorator? analyticsMetadataParamsDecorator,
}) : _analyticsMetadataParamsDecorator =
analyticsMetadataParamsDecorator ?? NoOpsParamsDecorator() {
if (clientSecret != null) {
_clientSecret = clientSecret;
_clientSecretHash = calculateClientSecretHash(
username!,
pool.getClientId()!,
_clientSecret!,
);
}
if (signInUserSession != null) {
_signInUserSession = signInUserSession;
}
client = pool.client;
authenticationFlowType = 'USER_SRP_AUTH';
this.storage = storage ??= pool.storage;
pool.storage = this.storage;
}