-
Notifications
You must be signed in to change notification settings - Fork 25
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
[🚫DO NOT MERGE 🚫] Cimb 1 FA oauth flow #348
base: develop
Are you sure you want to change the base?
Conversation
27b00dc
to
1616cec
Compare
e5e32cc
to
1286aed
Compare
ExampleApp/AppDelegate.swift
Outdated
|
||
private func handleExampleVerify1FA(verify1FACallbackUrl: URL, host: String) { | ||
let VERIFY_1FA = "complete1FA" | ||
let YAHOO_HOST = "completeYahoo1FA" |
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 there Yahoo changes as part of this?
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.
Yahoo has his own launcher (line 240).
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.
Right but is CIMB ever going to launch with Yahoo?
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.
No, I don't think so. I implemented the full feature because the trade service returns now a "complete1FA" closure.
In that case, we could ignore and do nothing here or return an error ? :
TradeItIosTicketSDK2/TradeItIosTicketSDK2/TradeItYahooTradePreviewViewController.swift
Line 113 in 1286aed
self.tradeSecurityHandler = complete1FA |
ExampleApp/AppDelegate.swift
Outdated
if let navController = topViewController as? UINavigationController, | ||
let navTopViewController = navController.topViewController { | ||
topViewController = navTopViewController | ||
} |
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.
Do we do this calculation somewhere else? Maybe we should create a function for it instead of duplicating
_ onCancelSecurityQuestion: @escaping () -> Void | ||
onVerifyUrl: @escaping ( | ||
URL, | ||
_ complete1FA: @escaping () -> Void |
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.
Indentation looks incorrect here. Also why was the onSecurityQuestion
removed? Was that only used by CIMB?
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.
Yes security question was added specifically for CIMB
guard let oAuthUrl = verifyOAuthURLResult.oAuthUrl() else { | ||
onFailure( | ||
TradeItErrorResult( | ||
title: "Received empty OAuth verify popup URL" |
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 message will be displayed to the user. Should make it user friendly.
onAnswerSecurityQuestion: answerSecurityQuestion, | ||
onCancelSecurityQuestion: cancelSecurityQuestion | ||
) | ||
onVerifyUrl: { url, complete1FA in |
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.
The 1FA
naming is a little jarring - challenge
seems a little clearer. This can totally wait for a follow up when we look to merge though.
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.
Maybe completeTradeChallenge
because if you add just challenge1FA
or completeChallenge
to the SDK configuration then it's not clear what it's for.
cancelOrderSecurityHandler() | ||
} else { | ||
return self.alertManager.showError( | ||
TradeItErrorResult.error(withSystemMessage: "Canceling order could not be submitted please try again."), |
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 will show the default error message to the user. systemMessage
is logged to console. Re-word to something like: Your cancel order request could not be submitted. Please try again.
tradeSecurityHandler() | ||
} else { | ||
return self.alertManager.showError( | ||
TradeItErrorResult.tradeError(withSystemMessage: "Trade could not be submitted please try again."), |
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.
Same comment as for cancel
originalViewController = topMostViewController.presentingViewController | ||
} | ||
|
||
if let tradeItYahooTradePreviewViewController = originalViewController?.childViewControllers.last as? TradeItYahooTradePreviewViewController { |
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.
Do these 1FA changes need to be made to Yahoo?
@@ -240,7 +237,20 @@ class TradeItYahooTradePreviewViewController: TradeItYahooViewController, UITabl | |||
} | |||
|
|||
// MARK: Private | |||
|
|||
|
|||
private var tradeSecurityHandler: (() -> Void)? |
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.
Do these 1FA changes need to be made to Yahoo?
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.
I fully implemented the feature, but we could ignore and do nothing here or return an error:
TradeItIosTicketSDK2/TradeItIosTicketSDK2/TradeItYahooTradePreviewViewController.swift
Line 113 in 1286aed
self.tradeSecurityHandler = complete1FA |
1286aed
to
ddcaadc
Compare
a47926d
to
ee55154
Compare
ee55154
to
28fe7e7
Compare
No description provided.