 
     @subscribe $(document.body), 'click focusin', (e) =>
       @detach() unless $.contains(this[0], e.target)
+
+  serialize: -> {@signedInUser}
 
   validate: ->
     canSignIn = $.trim(@username.val()).length > 0 and @password.val().length > 0

    @setElementEnabled(@password, false)
    @setElementEnabled(@signIn, false)

    credentials = btoa("#{$.trim(@username.val())}:#{@password.val()}")
    request =
      scopes: ['user', 'repo', 'gist']
      note: 'GitHub Atom'


      success: ({token}={}) =>
        if token?.length > 0
          @signedInUser = username
          unless keytar.replacePassword('github.com', 'github', token)
            console.warn 'Unable to save GitHub token to keychain'
        @detach()
