 
     @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'

ScrollView = require 'scroll-view'
keytar = require 'keytar'

class SignInView extends ScrollView
  @content: ->
    @div class: 'sign-in-view overlay from-top', =>
      @h4 'Sign in to GitHub'
