-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BAH-4157 | Migrate HIP Initiated Linking Flow to use ABDM v3 APIs #181
base: abdm-v3
Are you sure you want to change the base?
Conversation
break; | ||
} | ||
i++; | ||
} while (i < gatewayConfiguration.Counter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a loop,can we consider an event-driven mechanism that waits asynchronously for updates to UserAuthMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is taken consciously to keep it simple. Also, the execution needs to wait until we get a linking token to proceed with linking of care-context. This is added since to token comes on a callback response from gateway
} | ||
var authConfirm = new AuthConfirm(healthId, accessToken); | ||
var savedAuthConfirm = userAuthRepository.Get(healthId).Result; | ||
if (savedAuthConfirm.Equals(Option.Some<AuthConfirm>(null))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not using simpler, clearer null-checks? Like,
if (savedAuthConfirm == null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is checked in this way because the return for userAuthRepository.Get is always an Option instead of a null. So a simple null check would return false since the object would be initialised with an instance of Option having a null value.
This PR incorporates the following changes