Collect registration data


#1

Hi,

I have a question regarding silhouette-play-react-seed template.

The registration data for the User which can be found in app-core/src/main/scala/core/models/Registration.scala - Is there some special library/modue for React which gathers all the necessary registration data when user signs up?

I am using Twirl server-side templating ( from play-silhouette-seed project) and was wondering how this registration data can be collected there.


#2

Hi,

Could you please be a bit more detailed? What do you try to achieve?

Best regards,
Christian


#3

Sorry for not being clear enough.

I would like to enhance my case class User ( copied from play-silhouette-seed template)

User(
  userID: UUID,
  loginInfo: LoginInfo,
  firstName: Option[String],
  lastName: Option[String],
  fullName: Option[String],
  email: Option[String],
  avatarURL: Option[String],
  activated: Boolean) extends Identity

with registration data from /app-core/src/main/scala/core/models/Registration.scala (silhouette-play-react-seed template)

Registration(
  lang: Lang,
  ip: String,
  host: Option[String],
  userAgent: Option[String],
  activated: Boolean,
  dateTime: Instant
)

Can I do that if I am using server-side rendered Twirl templates instead of React ? I am mostly concerned how these lang, ip, host, etc will be gathered if I am not using React


#4

For me it’s not clear what template and which architecture do you use. Do you use the classic, static, web application which the play-silhouette-seed project represents? Or do you use the modern SPA (single page app) which the silhouette-play-react-seed represents?


#5

I use classic, static, web application which the play-silhouette-seed project represents!


#6

OK, so you try to add new data to your user model? The data lang, ip and host are all available in the request and your request is available in your action. So if you have an action that registers your user, then you have access to this values and can store it in your model.