Is there a config option (maybe in the redirectToSignIn method that prevents a new tab from popping open?
I’ve been building out some OAUTH integrations in Graphite, and having the entire OAUTH flow happen in one window then having the user redirected back in that same issue is such a better experience. I’d like to apply that to authentication with Blockstack.
1 Like
larry
September 18, 2018, 3:17pm
#2
The new tab opening behavior is determined by your default browser. We just call the operating system method for opening a URL:
openPortal(path: "/account")
}
func openPortal(path: String) {
let portalURLString = "\(portalBaseUrl())\(path)"
os_log("Opening portal with String: %{public}@", log: log, type: .info, portalURLString)
let portalURLWithSecretString = "\(portalURLString)#coreAPIPassword=\(createOrRetrieveCoreWalletPassword())"
let portalURLWithSecretAndLogPortString = "\(portalURLWithSecretString)&logServerPort=\(logServerPort)"
let portalURLWithSecretLogPortAndRegtest = "\(portalURLWithSecretAndLogPortString)®test=\(isRegTestModeEnabled ? 1 : 0)"
let portalURL = URL(string: portalURLWithSecretLogPortAndRegtest)
NSWorkspace.shared().open(portalURL!)
}
func statusItemClick(sender: AnyObject?) {
os_log("statusItemClick", log: log, type: .debug)
let menu = NSMenu()
var showExpandedMenu = false
if(NSApp.currentEvent?.modifierFlags.contains(NSEventModifierFlags.option) ?? false) {
If we create a browser extension and/or remove support for the blockstack:
custom protocol handler, we could change the new tab opening behavior.
2 Likes