Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ThisBuild / organization := "app.softnetwork"

name := "account"

ThisBuild / version := "0.8.4"
ThisBuild / version := "0.8.5"

ThisBuild / scalaVersion := scala212

Expand Down
9 changes: 9 additions & 0 deletions common/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@ auth {
resetPasswordUrl = ${?AUTH_RESET_PASSWORD_URL}
reset-password-url = ${auth.resetPasswordUrl}

# Activation link emitted in the account-activation email. `{token}` is replaced with the
# activation token. Default reproduces the historical `${baseUrl}/${path}/activate/<token>`
# (backend, path-style). Override (e.g. AUTH_ACTIVATION_URL=https://app.example.com/activate?token={token})
# for SPA frontends that expect a query-style token on a dedicated activation route.
activationUrl = ${auth.baseUrl}"/"${auth.path}"/activate/{token}"
activationUrl = ${?AUTH_ACTIVATION_URL}
activation-url = ${auth.activationUrl}

regenerationOfThePasswordResetToken = true
regeneration-of-the-password-reset-token = ${auth.regenerationOfThePasswordResetToken}

akka-node-role = accounts

activation {
enabled = true
enabled = ${?AUTH_ACTIVATION_ENABLED}
token {
expirationTime = 1440
expirationTime = ${?AUTH_ACTIVATION_TOKEN_EXPIRATION_TIME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ object AccountSettings extends StrictLogging {

val ResetPasswordUrl: String = config.getString("auth.resetPasswordUrl")

/** Activation link template emitted in the activation email. Contains a `{token}` placeholder
* replaced with the activation token. Defaults to `${baseUrl}/${path}/activate/{token}`.
*/
val ActivationUrl: String = config.getString("auth.activationUrl")

val RegenerationOfThePasswordResetToken: Boolean =
config.getBoolean("auth.regenerationOfThePasswordResetToken")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ trait AccountNotifications[T <: Account] extends Completion {
case Some(s) => StringEscapeUtils.escapeHtml4(s.firstName)
case _ => "customer"
}),
"activationUrl" -> s"$BaseUrl/$Path/activate/${activationToken.token}",
"activationUrl" -> ActivationUrl.replace("{token}", activationToken.token),
"signature" -> NotificationsConfig.signature
)
)
Expand Down
Loading