title: PFLoginViewController reappears after successful login
body: <p>I'm using Parse's LoginViewController, and after a login or signup is successful, it dismisses the login screen, only to immediately bring it back up, rather than continuing to the next ViewController. I'm positive that the login is going through successfully. </p>
  
  <p>DefaultSettingsViewController.m:</p>
  
  <pre><code>- (void)viewDidLoad
  
  {
  
      [super viewDidLoad];
  
  // Do any additional setup after loading the view.
  
  }
  
  
  
  - (void)viewDidUnload
  
  {
  
      [super viewDidUnload];
  
      // Release any retained subviews of the main view.
  
  }
  
  
  
  - (void)viewWillAppear:(BOOL)animated {
  
      [super viewDidLoad];
  
      if ([PFUser currentUser]) {
  
          //[welcomeLabel setText:[NSString stringWithFormat:@"Welcome Back %@!", [[PFUser currentUser] username]]];
  
          NSLog(@"PFUser is not current user");
  
  
  
      } else {
  
          NSLog(@"PFUser is current user");
  
          //[welcomeLabel setText:@"Not logged in"];
  
      }
  
  }
  
  
  
  - (void)viewDidAppear:(BOOL)animated {
  
      [super viewDidAppear:animated];
  
  
  
      PFLogInViewController *login = [[PFLogInViewController alloc] init];
  
      login.fields = PFLogInFieldsUsernameAndPassword | PFLogInFieldsLogInButton | PFLogInFieldsTwitter | PFLogInFieldsFacebook | PFLogInFieldsSignUpButton | PFLogInFieldsPasswordForgotten;
  
      login.delegate = self;
  
      login.signUpController.delegate = self;
  
      [self presentModalViewController:login animated:YES];
  
  
  
  
  
      if (![PFUser currentUser]) { // No user logged in
  
          // Create the log in view controller
  
          PFLogInViewController *logInViewController = [[PFLogInViewController alloc] init];
  
          [logInViewController setDelegate:self]; // Set ourselves as the delegate
  
  
  
          // Create the sign up view controller
  
          PFSignUpViewController *signUpViewController = [[PFSignUpViewController alloc] init];
  
          [signUpViewController setDelegate:self]; // Set ourselves as the delegate
  
  
  
          // Assign our sign up controller to be displayed from the login controller
  
          [logInViewController setSignUpController:signUpViewController];
  
  
  
          // Present the log in view controller
  
          [self presentViewController:logInViewController animated:YES completion:NULL];
  
      } else {
  
          [self performSegueWithIdentifier:@"login" sender:self];
  
      }
  
  
  
  }
  </code></pre>