         var font: UIFont = UIFont(name: "ProximaNova-Light", size: 20)!
         nav?.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName:font]
         
+        autoLogin()
+    }
+    
+    func autoLogin() {
+        // If we already have an auth observer, remove that one.
+        if authHandler != nil {
+            ref.removeAuthEventObserverWithHandle(authHandler)
+        }
+        
         // Automatically log in when we are auth'd
         authHandler = ref.observeAuthEventWithBlock({
             [unowned self] authData in

        } else {
            // We successfully obtained an OAuth token, authenticate on Firebase with it
            ref.authWithOAuthProvider("google", token: auth.accessToken,
                withCompletionBlock: { error, authData in
                    if error != nil {
                        // Error authenticating with Firebase with OAuth token
                    } else {

        var signIn = GPPSignIn.sharedInstance()
        signIn.shouldFetchGooglePlusUser = true
        signIn.clientID = "311395164163-bhjoq6cb43hh1n92l7ntb8180uplbcll.apps.googleusercontent.com"
        signIn.scopes = [] // We pass an empty array to force Google login instead of Google+ login
        signIn.delegate = self
        // authenticate will do a callback to finishedWithAuth:error:
        signIn.authenticate()
