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

Support customizable callback url-scheme. #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

noppefoxwolf
Copy link
Contributor

No description provided.

Copy link
Contributor

@meteochu meteochu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the late review, added a comment requesting change on the method signature to prevent duplication of the code. Using an optional String for the callback url scheme can help prevent code duplication.

authorizeSSO(withCallback: urlScheme, success: success, failure: failure)
}

func authorizeSSO(withCallback urlScheme: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating the method signature with a customizable callback URL, this should use an optional callback.

func authorizeSSO(
    withCallbackURLScheme urlScheme: String? = nil, 
    success: SSOTokenSuccessHandler, 
    failure: FailureHandler? = nil
) {
    guard let client = client as? SwifterAppProtocol else { 
        // handle error
        return
    } 
    let urlScheme = urlScheme ?? "swifter-\(client.consumerKey)"
    // ...
}

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

Successfully merging this pull request may close these issues.

None yet

2 participants