 import SafariServices
 
 private let loginURL = URL(string: "http://github.com/login/oauth/authorize?client_id=\(GithubAPI.clientID)&scope=user+repo+notifications")!
+private let callbackURLScheme = "freetime://"
 
 final class LoginSplashViewController: UIViewController, GithubSessionListener {
 

    // MARK: Private API

    @IBAction func onSignInButton(_ sender: Any) {
		guard let safariController = try? SFSafariViewController.configured(with: loginURL) else { return }
        self.safariController = safariController
        present(safariController, animated: true)
    }

    @IBAction func onPersonalAccessTokenButton(_ sender: Any) {

    @IBOutlet weak var activityIndicator: UIActivityIndicatorView!
    private weak var safariController: SFSafariViewController? = nil

    @available(iOS 11.0, *)
    private var authSession: SFAuthenticationSession? {
        get {
            return _authSession as? SFAuthenticationSession
        }
        set {
            _authSession = newValue
        }
    }
    private var _authSession: Any?
    
    var state: State = .idle {
        didSet {
            let hideSpinner: Bool
