mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-05 10:59:33 +00:00
Fix rememberme for missing local storage
This commit is contained in:
parent
5eaa8e9ac6
commit
0b6f965fcb
@ -124,11 +124,13 @@ object Login {
|
||||
minTime = now - config.rememberMe.valid
|
||||
data <- OptionT(store.transact(QLogin.findByRememberMe(rid, minTime).value))
|
||||
_ <- OptionT.liftF(
|
||||
logF.warn(s"Account lookup via remember me: $data")
|
||||
logF.info(s"Account lookup via remember me: $data")
|
||||
)
|
||||
res <- OptionT.liftF(
|
||||
if (checkNoPassword(data)) okResult(data.account)
|
||||
else Result.invalidAuth.pure[F]
|
||||
if (checkNoPassword(data))
|
||||
logF.info("RememberMe auth successful") *> okResult(data.account)
|
||||
else
|
||||
logF.warn("RememberMe auth not successfull") *> Result.invalidAuth.pure[F]
|
||||
)
|
||||
} yield res).getOrElseF(
|
||||
logF.info("RememberMe not found in database.") *> Result.invalidAuth.pure[F]
|
||||
|
@ -7,7 +7,6 @@ import Api
|
||||
import App.Data exposing (..)
|
||||
import Browser exposing (UrlRequest(..))
|
||||
import Browser.Navigation as Nav
|
||||
import Comp.LinkTarget
|
||||
import Data.Flags
|
||||
import Page exposing (Page(..))
|
||||
import Page.CollectiveSettings.Data
|
||||
@ -112,7 +111,16 @@ updateWithSub msg model =
|
||||
|
||||
command =
|
||||
if lr.success then
|
||||
Api.refreshSession newFlags SessionCheckResp
|
||||
Cmd.batch
|
||||
[ Api.refreshSession newFlags SessionCheckResp
|
||||
, Ports.setAccount lr
|
||||
, case model.flags.account of
|
||||
Just _ ->
|
||||
Cmd.none
|
||||
|
||||
Nothing ->
|
||||
Page.goto model.page
|
||||
]
|
||||
|
||||
else
|
||||
Cmd.batch
|
||||
|
@ -51,21 +51,13 @@ init flags url key =
|
||||
|
||||
else
|
||||
( im, Page.goto page, Sub.none )
|
||||
|
||||
sessionCheck =
|
||||
case m.flags.account of
|
||||
Just _ ->
|
||||
Api.loginSession flags SessionCheckResp
|
||||
|
||||
Nothing ->
|
||||
Cmd.none
|
||||
in
|
||||
( { m | subs = s }
|
||||
, Cmd.batch
|
||||
[ cmd
|
||||
, ic
|
||||
, Api.versionInfo flags VersionResp
|
||||
, sessionCheck
|
||||
, Api.loginSession flags SessionCheckResp
|
||||
, Ports.getUiSettings flags
|
||||
]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user