Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OO#84 extract validity of token to a property in the configuration #611

Merged
merged 1 commit into from
Feb 25, 2022
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
5 changes: 5 additions & 0 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ openolitor {
aws-secret-acccess-key = "thedefaultminiosecretneedstobechanged"
}

mail {
invite-expiration-time-in-days = 90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a suggestion for future changes: we could also use durations like 90 days and load them as such in the code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't know. Thanks!

mail.password-reset-message-expiration-time-in-minutes = 120
}

smtp {
from = "info@openolitor.ch"
endpoint = "localhost"
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/openolitor-server-test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ openolitor {
bcc = ${?OO_SERVICES.smtp-object.mandant1.bcc}
}

mail {
invite-expiration-time-in-days = 90
mail.password-reset-message-expiration-time-in-minutes = 120
}

converttopdf {
endpoint = "http://pdftools.openolitor.ch/lool/convert-to/pdf"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import com.typesafe.scalalogging.LazyLogging
import ch.openolitor.core.domain.EntityStore._
import akka.actor.ActorSystem
import ch.openolitor.core.Macros._
import ch.openolitor.core.Macros._
import ch.openolitor.stammdaten.models.{ Waehrung, CHF, EUR }
import ch.openolitor.stammdaten.models.KontoDaten
import ch.openolitor.util.ConfigUtil._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package ch.openolitor.stammdaten
import ch.openolitor.buchhaltung.models.{ RechnungsPositionStatus, RechnungsPositionTyp }
import ch.openolitor.core.domain._
import ch.openolitor.core.models._
import ch.openolitor.util.ConfigUtil._

import scala.util._
import scalikejdbc.DB
Expand Down Expand Up @@ -706,7 +707,7 @@ trait StammdatenCommandHandler extends CommandHandler with StammdatenDBMappings
idFactory.newId(EinladungId.apply),
personId,
UUID.randomUUID.toString,
DateTime.now.plusDays(90),
DateTime.now.plusDays(config.getIntOption(s"mail.invite-expiration-time-in-days").getOrElse(90)),
None
)))))
} getOrElse {
Expand All @@ -726,7 +727,7 @@ trait StammdatenCommandHandler extends CommandHandler with StammdatenDBMappings
idFactory.newId(EinladungId.apply),
personId,
UUID.randomUUID.toString,
DateTime.now.plusMinutes(120),
DateTime.now.plusMinutes(config.getIntOption(s"mail.password-reset-message-expiration-time-in-minutes").getOrElse(120)),
None
)))))
} getOrElse {
Expand Down