Tesobe will use your information as set out in our privacy notice
## For partner logos and links
webui_main_partners=[\
@@ -597,8 +596,8 @@ webui_main_style_sheet = /media/css/website.css
# Override certain elements (with important styles)
webui_override_style_sheet =
-## Link to agree to Terms & Conditions (no longer used - signup removed)
-# webui_agree_terms_url =
+## Link to agree to Terms & Conditions, shown on signup page
+webui_agree_terms_url =
## The Support Email, shown in the bottom page
#webui_support_email=contact@openbankproject.com
@@ -626,9 +625,6 @@ webui_override_style_sheet =
#webui_post_consumer_registration_submit_button_value=Register consumer
# OBP Portal URL - base URL for the OBP Portal service
-# Used for:
-# - User registration: {webui_obp_portal_url}/register (all "Register" links redirect here)
-# - Consumer registration: {webui_obp_portal_url}/consumer-registration (default)
webui_obp_portal_url = http://localhost:5174
# External Consumer Registration URL - used to redirect "Get API Key" links to an external service
diff --git a/obp-api/src/main/scala/code/api/util/Glossary.scala b/obp-api/src/main/scala/code/api/util/Glossary.scala
index 15adc55bb..cde7dd1dd 100644
--- a/obp-api/src/main/scala/code/api/util/Glossary.scala
+++ b/obp-api/src/main/scala/code/api/util/Glossary.scala
@@ -1249,7 +1249,7 @@ object Glossary extends MdcLoggable {
|
|### 1) Get your App key
|
- |[Sign up](${APIUtil.getPropsValue("webui_obp_portal_url", "http://localhost:5174")}/register) or [login]($getServerUrl/user_mgt/login) as a developer.
+ |[Sign up]($getServerUrl/user_mgt/sign_up) or [login]($getServerUrl/user_mgt/login) as a developer.
|
|Register your App key [HERE](${getConsumerRegistrationUrl()})
|
@@ -2305,7 +2305,7 @@ object Glossary extends MdcLoggable {
|
|### Step 1: Get your App key
|
- |[Sign up](${APIUtil.getPropsValue("webui_obp_portal_url", "http://localhost:5174")}/register) or [login]($getServerUrl/user_mgt/login) as a developer
+ |[Sign up]($getServerUrl/user_mgt/sign_up) or [login]($getServerUrl/user_mgt/login) as a developer
|
|Register your App key [HERE](${getConsumerRegistrationUrl()})
|
@@ -2954,7 +2954,7 @@ object Glossary extends MdcLoggable {
|
|## In order to get an App / Consumer key
|
-|[Sign up](${APIUtil.getPropsValue("webui_obp_portal_url", "http://localhost:5174")}/register) or [login]($getServerUrl/user_mgt/login) as a developer.
+|[Sign up]($getServerUrl/user_mgt/sign_up) or [login]($getServerUrl/user_mgt/login) as a developer.
|
|Register your App / Consumer [HERE](${getConsumerRegistrationUrl()})
|
diff --git a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala
index 11efcde0d..de1989065 100644
--- a/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala
+++ b/obp-api/src/main/scala/code/model/dataAccess/AuthUser.scala
@@ -229,7 +229,7 @@ class AuthUser extends MegaProtoUser[AuthUser] with CreatedUpdated with MdcLogga
override lazy val password = new MyPasswordNew
- // Removed signup password repeat text - not needed with OBP Portal redirect
+ lazy val signupPasswordRepeatText = getWebUiPropsValue("webui_signup_body_password_repeat_text", S.?("repeat"))
class MyPasswordNew extends MappedPassword(this) {
lazy val preFilledPassword = if (APIUtil.getPropsAsBoolValue("allow_pre_filled_password", true)) {get.toString} else ""
@@ -238,9 +238,14 @@ class AuthUser extends MegaProtoUser[AuthUser] with CreatedUpdated with MdcLogga
Full(
{appendFieldId( ) }
-
+
+
{signupPasswordRepeatText}
+
+
+
+
)
}
}
@@ -424,6 +429,7 @@ import net.liftweb.util.Helpers._
override def screenWrap = Full()
// define the order fields will appear in forms and output
override def fieldOrder = List(id, firstName, lastName, email, username, password, provider)
+ override def signupFields = List(firstName, lastName, email, username, password)
// To force validation of email addresses set this to false (default as of 29 June 2021)
override def skipEmailValidation = APIUtil.getPropsAsBoolValue("authUser.skipEmailValidation", false)
@@ -692,7 +698,28 @@ import net.liftweb.util.Helpers._
case _ => S.error(S.?("invalid.validation.link")); S.redirectTo(homePage)
}
-
+ override def actionsAfterSignup(theUser: TheUserType, func: () => Nothing): Nothing = {
+ theUser.setValidated(skipEmailValidation).resetUniqueId()
+ theUser.save
+ val privacyPolicyValue: String = getWebUiPropsValue("webui_privacy_policy", "")
+ val termsAndConditionsValue: String = getWebUiPropsValue("webui_terms_and_conditions", "")
+ // User Agreement table
+ UserAgreementProvider.userAgreementProvider.vend.createUserAgreement(
+ theUser.user.foreign.map(_.userId).getOrElse(""), "privacy_conditions", privacyPolicyValue)
+ UserAgreementProvider.userAgreementProvider.vend.createUserAgreement(
+ theUser.user.foreign.map(_.userId).getOrElse(""), "terms_and_conditions", termsAndConditionsValue)
+ if (!skipEmailValidation) {
+ sendValidationEmail(theUser)
+ S.notice(S.?("sign.up.message"))
+ func()
+ } else {
+ grantDefaultEntitlementsToAuthUser(theUser)
+ logUserIn(theUser, () => {
+ S.notice(S.?("welcome"))
+ func()
+ })
+ }
+ }
/**
* Set this to redirect to a certain page after a failed login
*/
@@ -701,9 +728,87 @@ import net.liftweb.util.Helpers._
}
- // Removed signup-related methods: agreeTermsDiv, legalNoticeDiv, agreePrivacyPolicy
- // These were only used in signup forms which now redirect to OBP Portal
- // Signup functionality removed - users are directed to OBP Portal for registration
+ def agreeTermsDiv = {
+ val webUi = new WebUI
+ val webUiPropsValue = getWebUiPropsValue("webui_terms_and_conditions", "")
+ val termsAndConditionsCheckboxTitle = Helper.i18n("terms_and_conditions_checkbox_text", Some("I agree to the above Terms and Conditions"))
+ val termsAndConditionsCheckboxLabel = Helper.i18n("terms_and_conditions_checkbox_label", Some("Terms and Conditions"))
+ val agreeTermsHtml = s"""
+ |
+ }
}
}
@@ -1498,8 +1610,67 @@ def restoreSomeSessions(): Unit = {
val usernames: List[String] = this.getResourceUsersByEmail(email).map(_.user.name)
findAll(ByList(this.username, usernames))
}
+ def signupSubmitButtonValue() = getWebUiPropsValue("webui_signup_form_submit_button_value", S.?("sign.up"))
+ //overridden to allow redirect to loginRedirect after signup. This is mostly to allow
+ // loginFirst menu items to work if the user doesn't have an account. Without this,
+ // if a user tries to access a logged-in only page, and then signs up, they don't get redirected
+ // back to the proper page.
+ override def signup = {
+ val theUser: TheUserType = mutateUserOnSignup(createNewUserInstance())
+ val theName = signUpPath.mkString("")
+ //Check the internal redirect, in case for open redirect issue.
+ // variable redir is from loginRedirect, it is set-up in OAuthAuthorisation.scala as following code:
+ // val currentUrl = ObpS.uriAndQueryString.getOrElse("/")
+ // AuthUser.loginRedirect.set(Full(Helpers.appendParams(currentUrl, List((LogUserOutParam, "false")))))
+ val loginRedirectSave = loginRedirect.is
+
+ def testSignup() {
+ validateSignup(theUser) match {
+ case Nil =>
+ //here we check loginRedirectSave (different from implementation in super class)
+ val redir = loginRedirectSave match {
+ case Full(url) =>
+ loginRedirect(Empty)
+ url
+ case _ =>
+ //if the register page url (user_mgt/sign_up?after-signup=link-to-customer) contains the parameter
+ //after-signup=link-to-customer,then it will redirect to the on boarding customer page.
+ ObpS.param("after-signup") match {
+ case url if (url.equals("link-to-customer")) =>
+ "/add-user-auth-context-update-request"
+ case _ =>
+ homePage
+ }
+ }
+ if (Helper.isValidInternalRedirectUrl(redir.toString)) {
+ actionsAfterSignup(theUser, () => {
+ S.redirectTo(redir)
+ })
+ } else {
+ S.error(S.?(ErrorMessages.InvalidInternalRedirectUrl))
+ logger.info(ErrorMessages.InvalidInternalRedirectUrl + loginRedirect.get)
+ }
+
+ case xs =>
+ xs.foreach{
+ e => S.error(e.field.uniqueFieldId.openOrThrowException("There is no uniqueFieldId."), e.msg)
+ }
+ signupFunc(Full(innerSignup _))
+ }
+ }
+
+ def innerSignup = {
+ val bind = "type=submit" #> signupSubmitButton(signupSubmitButtonValue(), testSignup _)
+ bind(signupXhtml(theUser))
+ }
+
+ if(APIUtil.getPropsAsBoolValue("user_invitation.mandatory", false))
+ S.redirectTo("/user-invitation-info")
+ else
+ innerSignup
+ }
def scrambleAuthUser(userPrimaryKey: UserPrimaryKey): Box[Boolean] = tryo {
AuthUser.find(By(AuthUser.user, userPrimaryKey.value)) match {
diff --git a/obp-api/src/main/scala/code/snippet/Login.scala b/obp-api/src/main/scala/code/snippet/Login.scala
index 1ae8ce83b..a7c6a36c3 100644
--- a/obp-api/src/main/scala/code/snippet/Login.scala
+++ b/obp-api/src/main/scala/code/snippet/Login.scala
@@ -70,11 +70,8 @@ class Login {
href getOrElse "#"
} & {
".signup [href]" #> {
- val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
- s"$portalUrl/register"
- } &
- ".signup [target]" #> "_blank" &
- ".signup [rel]" #> "noopener"
+ AuthUser.signUpPath.foldLeft("")(_ + "/" + _)
+ }
}
}
}
diff --git a/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala b/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
index be038b035..66a598627 100644
--- a/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
+++ b/obp-api/src/main/scala/code/snippet/OAuthAuthorisation.scala
@@ -46,7 +46,6 @@ import net.liftweb.http.S
import net.liftweb.util.Helpers._
import net.liftweb.util.{CssSel, Helpers, Props}
import code.api.oauth1a.OauthParams._
-import code.webuiprops.MappedWebUiPropsProvider.getWebUiPropsValue
import scala.xml.NodeSeq
@@ -151,12 +150,8 @@ object OAuthAuthorisation {
href getOrElse "#"
} &
- ".signup [href]" #> {
- val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
- s"$portalUrl/register"
- } &
- ".signup [target]" #> "_blank" &
- ".signup [rel]" #> "noopener"
+ ".signup [href]" #>
+ AuthUser.signUpPath.foldLeft("")(_ + "/" + _)
}
}
case _ => error("Application not found")
diff --git a/obp-api/src/main/scala/code/snippet/WebUI.scala b/obp-api/src/main/scala/code/snippet/WebUI.scala
index c8861688b..5b0704a02 100644
--- a/obp-api/src/main/scala/code/snippet/WebUI.scala
+++ b/obp-api/src/main/scala/code/snippet/WebUI.scala
@@ -550,21 +550,8 @@ class WebUI extends MdcLoggable{
def userIsLoggedIn: CssSel = {
if(AuthUser.loggedIn_?)
"#register-link [href]" #> scala.xml.Unparsed(s"/already-logged-in")
- else {
- val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
- val registerUrl = s"$portalUrl/register"
- "#register-link [href]" #> scala.xml.Unparsed(registerUrl) &
- "#register-link [target]" #> "_blank" &
- "#register-link [rel]" #> "noopener"
- }
- }
-
- def portalRegisterLink: CssSel = {
- val portalUrl = getWebUiPropsValue("webui_obp_portal_url", "http://localhost:5174")
- val registerUrl = s"$portalUrl/register"
- "a [href]" #> scala.xml.Unparsed(registerUrl) &
- "a [target]" #> "_blank" &
- "a [rel]" #> "noopener"
+ else
+ "#register-link [href]" #> scala.xml.Unparsed(s"/user_mgt/sign_up")
}
def alreadyLoggedIn: CssSel = {
diff --git a/obp-api/src/main/webapp/index-en.html b/obp-api/src/main/webapp/index-en.html
index 32075b8b4..a0dd0210c 100644
--- a/obp-api/src/main/webapp/index-en.html
+++ b/obp-api/src/main/webapp/index-en.html
@@ -59,7 +59,7 @@ Berlin 13359, Germany
Create an account
-
First, create a free developer account on this sandbox and request a developer key. You will be asked to submit basic information about your app at this stage. Register for an account
+
diff --git a/obp-api/src/main/webapp/index.html b/obp-api/src/main/webapp/index.html
index 92fabd6ba..54b4d75a3 100644
--- a/obp-api/src/main/webapp/index.html
+++ b/obp-api/src/main/webapp/index.html
@@ -59,7 +59,7 @@ Berlin 13359, Germany
Create an account
-
First, create a free developer account on this sandbox and request a developer key. You will be asked to submit basic information about your app at this stage. Register for an account
+