<commit_before>package controllers

import play.Logger
import play.api.data.Form
import play.api.mvc.{ Session, Result, Controller, Action, RequestHeader }
import play.api.data.validation.Constraints
import play.api.i18n.Messages
import play.api.mvc.Flash
import securesocial.core.java.UserAwareAction
import securesocial.core.RuntimeEnvironment
import models.User
import com.amazonaws.auth.EnvironmentVariableCredentialsProvider
import com.amazonaws.services.simpledb.AmazonSimpleDBClient
import com.amazonaws.services.simpledb.model.CreateDomainRequest
import com.amazonaws.services.simpledb.model.ReplaceableItem
import service.SimpleDBRepository

class Application(override implicit val env: RuntimeEnvironment[User]) extends securesocial.core.SecureSocial[User] {

  def testSimpleDB = Action { implicit request =>
    SimpleDBRepository.saveUser(null)
    Ok("done")
  }

  def index = UserAwareAction { implicit request =>
    request.user match {
      case Some(u) => Ok(views.html.index(u))
      case None    => Ok(views.html.index(null))
    }
  }

  def signupRedirectURI = UserAwareAction { implicit request =>

    //    val user = request.user.get;
    //    if(user.newUser)
    Ok("")
  }

}<commit_msg>Redirect user after signup process, according to whether the user is a new user or not.<commit_after>package controllers

import play.Logger
import play.api.data.Form
import play.api.mvc.{ Session, Result, Controller, Action, RequestHeader }
import play.api.data.validation.Constraints
import play.api.i18n.Messages
import play.api.mvc.Flash
import securesocial.core.java.UserAwareAction
import securesocial.core.RuntimeEnvironment
import models.User
import com.amazonaws.auth.EnvironmentVariableCredentialsProvider
import com.amazonaws.services.simpledb.AmazonSimpleDBClient
import com.amazonaws.services.simpledb.model.CreateDomainRequest
import com.amazonaws.services.simpledb.model.ReplaceableItem
import service.SimpleDBRepository

class Application(override implicit val env: RuntimeEnvironment[User]) extends securesocial.core.SecureSocial[User] {

  def testSimpleDB = Action { implicit request =>
    SimpleDBRepository.saveUser(null)
    Ok("done")
  }

  def index = UserAwareAction { implicit request =>
    request.user match {
      case Some(u) => Ok(views.html.index(u))
      case None    => Ok(views.html.index(null))
    }
  }

  def signupRedirectURI = UserAwareAction { implicit request =>
    request.user match {
      case Some(u) if u.newUser  => Redirect(accounts.routes.Signup.showEnterUserDataForm)
      case Some(u) if !u.newUser => Redirect(accounts.routes.Index.user(u.username.get))
      case None                  => Redirect(routes.Application.index)
    }
  }

}
{'fraction_non_alphanumeric': 0.09522058823529411, 'fraction_numerical': 0.0014705882352941176, 'mean_word_length': 4.485887096774194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4802387', 'n_tokens_mistral': 791, 'n_tokens_neox': 784, 'n_words': 171}