Skip to content
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

Login not working after dismissed #124

Closed
auctifera-josed opened this issue Sep 23, 2020 · 1 comment
Closed

Login not working after dismissed #124

auctifera-josed opened this issue Sep 23, 2020 · 1 comment
Assignees
Labels

Comments

@auctifera-josed
Copy link

auctifera-josed commented Sep 23, 2020

Hi everyone, some users are experiencing an issue with the login if they dismissed it by tapping outside the view controller (if they tap in the cancel button there is no problem)

We have a "Log in" button that calls the following code

salesforce.identity(config: .shared)
.receive(on: DispatchQueue.main)
.sink(receiveCompletion: { (uCompletion) in
    ///stuff
}, receiveValue: { (userInfo : Identity) in
    ///stuff
}).store(in: &cancellables)

Then the salesforce login is presented in a modal which works fine, but if the user taps outside the modal the login modal is dismissed and there is no way of presenting the login view again

IMG_210C282AA8A6-1

I thought that maybe canceling the cancelable would help but it didn't

var loginCancelable: AnyCancellable?
    
func login(){
    if let loginCancelable = loginCancelable {
        loginCancelable.cancel()
    }
    
    loginCancelable = salesforce.identity(config: config)
    ...
}

Even tried reinitializing the salesforce property before calling the identity

...
salesforce = Salesforce(connectedApp: connectedApp, oAuthHostname: oauthHostName)
loginCancelable = salesforce.identity(config: config)
...

Does anyone have an idea what's going on here? Or maybe just how can we present the login modal in full screen so they can't tap outside?

@mike4aday mike4aday self-assigned this Sep 30, 2020
@mike4aday
Copy link
Owner

@auctifera-josed - I did try to capture the tap outside the login form gesture, but didn't succeed. Seems to be a limitation of Apple's prescribed authentication mechanism using ASWebAuthenticationSession.

Another idea I had but haven't had time yet to prototype: Salesforce allows you to specify a different form factor for the login form - see the display parameter at this link. Swiftly Salesforce currently uses touch -- maybe page offers a larger display which, if accommodated by ASWebAuthenticationSession, would make it less likely that the user clicks outside the bounds of the login form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants