Skip to content

Commit

Permalink
feat: Wording of error message update for invalid_grant #3205
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Dec 18, 2024
1 parent 98e0c08 commit 2a79877
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@ enum ResponseString {
RESPONSE_STRING_vpFormatsNotSupportedErrorDescription,
RESPONSE_STRING_invalidPresentationDefinitionUriErrorDescription,
RESPONSE_STRING_recoveryPhraseIncorrectErrorMessage,
RESPONSE_STRING_invalidCode,
}
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ extension ResponseStringX on ResponseString {
case ResponseString.RESPONSE_STRING_recoveryPhraseIncorrectErrorMessage:
return globalMessage
.RESPONSE_STRING_recoveryPhraseIncorrectErrorMessage;

case ResponseString.RESPONSE_STRING_invalidCode:
return globalMessage.RESPONSE_STRING_invalidCode;
}
}
}
1 change: 1 addition & 0 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@ ResponseString getErrorResponseString(String errorString) {
return ResponseString.RESPONSE_STRING_theWalletIsNotRegistered;

case 'invalid_grant':
return ResponseString.RESPONSE_STRING_invalidCode;
case 'invalid_token':
return ResponseString.RESPONSE_STRING_credentialIssuanceDenied;

Expand Down
2 changes: 2 additions & 0 deletions lib/app/shared/message_handler/global_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,6 @@ class GlobalMessage {

String get RESPONSE_STRING_recoveryPhraseIncorrectErrorMessage =>
l10n.recoveryPhraseIncorrectErrorMessage;

String get RESPONSE_STRING_invalidCode => l10n.invalidCode;
}
5 changes: 5 additions & 0 deletions lib/app/shared/message_handler/response_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,11 @@ class ResponseMessage with MessageHandler {
.RESPONSE_STRING_recoveryPhraseIncorrectErrorMessage.localise(
context,
);

case ResponseString.RESPONSE_STRING_invalidCode:
return ResponseString.RESPONSE_STRING_invalidCode.localise(
context,
);
}
}
return '';
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1173,5 +1173,6 @@
"reject": "Reject",
"operation": "Operation",
"chooseYourSSIProfileOrCustomizeYourOwn": "Choose your wallet profile or customize your own",
"recoveryPhraseIncorrectErrorMessage": " Please try again with correct order."
"recoveryPhraseIncorrectErrorMessage": " Please try again with correct order.",
"invalidCode": "Invalid code"
}
3 changes: 2 additions & 1 deletion lib/l10n/arb/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1139,5 +1139,6 @@
},
"reject": "Rejet",
"operation": "Opération",
"chooseYourSSIProfileOrCustomizeYourOwn": "Choisissez un écosystème pour votre wallet"
"chooseYourSSIProfileOrCustomizeYourOwn": "Choisissez un écosystème pour votre wallet",
"invalidCode": "Code invalide"
}
6 changes: 4 additions & 2 deletions lib/l10n/untranslated.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"reject",
"operation",
"chooseYourSSIProfileOrCustomizeYourOwn",
"recoveryPhraseIncorrectErrorMessage"
"recoveryPhraseIncorrectErrorMessage",
"invalidCode"
],

"es": [
Expand All @@ -18,7 +19,8 @@
"reject",
"operation",
"chooseYourSSIProfileOrCustomizeYourOwn",
"recoveryPhraseIncorrectErrorMessage"
"recoveryPhraseIncorrectErrorMessage",
"invalidCode"
],

"fr": [
Expand Down
24 changes: 12 additions & 12 deletions lib/oidc4vc/get_credential.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ Future<
return null;
}
}
dynamic credentialResponseDataValue;
try {
credentialResponseDataValue = await getSingleCredentialData(
profileCubit: profileCubit,
openIdConfiguration: openIdConfiguration,
accessToken: accessToken,
dio: Dio(),
credentialData: credentialData,
publicKeyForDPop: publicKeyForDPop,
dynamic credentialResponseDataValue;
try {
credentialResponseDataValue = await getSingleCredentialData(
profileCubit: profileCubit,
openIdConfiguration: openIdConfiguration,
accessToken: accessToken,
dio: Dio(),
credentialData: credentialData,
publicKeyForDPop: publicKeyForDPop,
);
} catch (e) {
rethrow;
}
} catch (e) {
rethrow;
}

/// update nonce value
if (credentialResponseDataValue is Map<String, dynamic>) {
Expand Down

0 comments on commit 2a79877

Please sign in to comment.