Skip to content

Commit

Permalink
Merge pull request #531 from etn-ccis/fix/send-email-to-validRegistra…
Browse files Browse the repository at this point in the history
…tion

pass email to validateUserRegistrationRequest
  • Loading branch information
ektaghag-eaton authored Dec 14, 2023
2 parents e282881 + d34e9e9 commit 17e40a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions login-workflow/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v4.0.2 (Unreleased)

### Fixed

- Pass `email` to `validateUserRegistrationRequest` RegistrationUIActions when available ([#529](https://github.com/etn-ccis/blui-react-workflows/issues/529)).

## v4.0.1 (December 4, 2023)

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export const VerifyCodeScreen: React.FC<VerifyCodeScreenProps> = (props) => {
} = props;

const handleOnNext = useCallback(
async (code: string) => {
async (code: string, email?: string) => {
try {
setIsLoading(true);
if (actions?.validateUserRegistrationRequest) {
// eslint-disable-next-line no-unsafe-optional-chaining
const { codeValid, accountExists } = await actions?.validateUserRegistrationRequest(code);
const { codeValid, accountExists } = await actions?.validateUserRegistrationRequest(code, email);

if (accountExists) {
updateScreenData({ screenId: 'VerifyCode', values: { code }, isAccountExist: accountExists });
Expand Down Expand Up @@ -141,7 +141,7 @@ export const VerifyCodeScreen: React.FC<VerifyCodeScreenProps> = (props) => {
...WorkflowCardActionsProps,
onNext: (data: any): void => {
setVerifyCode(data.code);
void handleOnNext(data.code);
void handleOnNext(data.code, emailAddress);
WorkflowCardActionsProps?.onNext?.();
},
onPrevious: (data: any): void => {
Expand Down

0 comments on commit 17e40a6

Please sign in to comment.