mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Prepare remember-me authentication variant
This commit is contained in:
@ -53,6 +53,12 @@ docspell.server {
|
||||
# How long an authentication token is valid. The web application
|
||||
# will get a new one periodically.
|
||||
session-valid = "5 minutes"
|
||||
|
||||
remember-me {
|
||||
enabled = true
|
||||
# How long the remember me cookie/token is valid.
|
||||
valid = "3 month"
|
||||
}
|
||||
}
|
||||
|
||||
# This endpoint allows to upload files to any collective. The
|
||||
|
@ -23,8 +23,10 @@ object LoginRoutes {
|
||||
|
||||
HttpRoutes.of[F] { case req @ POST -> Root / "login" =>
|
||||
for {
|
||||
up <- req.as[UserPass]
|
||||
res <- S.loginUserPass(cfg.auth)(Login.UserPass(up.account, up.password))
|
||||
up <- req.as[UserPass]
|
||||
res <- S.loginUserPass(cfg.auth)(
|
||||
Login.UserPass(up.account, up.password, up.rememberMe.getOrElse(false))
|
||||
)
|
||||
resp <- makeResponse(dsl, cfg, req, res, up.account)
|
||||
} yield resp
|
||||
}
|
||||
|
Reference in New Issue
Block a user