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
|
minTime = now - config.rememberMe.valid
|
||||||
data <- OptionT(store.transact(QLogin.findByRememberMe(rid, minTime).value))
|
data <- OptionT(store.transact(QLogin.findByRememberMe(rid, minTime).value))
|
||||||
_ <- OptionT.liftF(
|
_ <- OptionT.liftF(
|
||||||
logF.warn(s"Account lookup via remember me: $data")
|
logF.info(s"Account lookup via remember me: $data")
|
||||||
)
|
)
|
||||||
res <- OptionT.liftF(
|
res <- OptionT.liftF(
|
||||||
if (checkNoPassword(data)) okResult(data.account)
|
if (checkNoPassword(data))
|
||||||
else Result.invalidAuth.pure[F]
|
logF.info("RememberMe auth successful") *> okResult(data.account)
|
||||||
|
else
|
||||||
|
logF.warn("RememberMe auth not successfull") *> Result.invalidAuth.pure[F]
|
||||||
)
|
)
|
||||||
} yield res).getOrElseF(
|
} yield res).getOrElseF(
|
||||||
logF.info("RememberMe not found in database.") *> Result.invalidAuth.pure[F]
|
logF.info("RememberMe not found in database.") *> Result.invalidAuth.pure[F]
|
||||||
|
@ -7,7 +7,6 @@ import Api
|
|||||||
import App.Data exposing (..)
|
import App.Data exposing (..)
|
||||||
import Browser exposing (UrlRequest(..))
|
import Browser exposing (UrlRequest(..))
|
||||||
import Browser.Navigation as Nav
|
import Browser.Navigation as Nav
|
||||||
import Comp.LinkTarget
|
|
||||||
import Data.Flags
|
import Data.Flags
|
||||||
import Page exposing (Page(..))
|
import Page exposing (Page(..))
|
||||||
import Page.CollectiveSettings.Data
|
import Page.CollectiveSettings.Data
|
||||||
@ -112,7 +111,16 @@ updateWithSub msg model =
|
|||||||
|
|
||||||
command =
|
command =
|
||||||
if lr.success then
|
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
|
else
|
||||||
Cmd.batch
|
Cmd.batch
|
||||||
|
@ -51,21 +51,13 @@ init flags url key =
|
|||||||
|
|
||||||
else
|
else
|
||||||
( im, Page.goto page, Sub.none )
|
( im, Page.goto page, Sub.none )
|
||||||
|
|
||||||
sessionCheck =
|
|
||||||
case m.flags.account of
|
|
||||||
Just _ ->
|
|
||||||
Api.loginSession flags SessionCheckResp
|
|
||||||
|
|
||||||
Nothing ->
|
|
||||||
Cmd.none
|
|
||||||
in
|
in
|
||||||
( { m | subs = s }
|
( { m | subs = s }
|
||||||
, Cmd.batch
|
, Cmd.batch
|
||||||
[ cmd
|
[ cmd
|
||||||
, ic
|
, ic
|
||||||
, Api.versionInfo flags VersionResp
|
, Api.versionInfo flags VersionResp
|
||||||
, sessionCheck
|
, Api.loginSession flags SessionCheckResp
|
||||||
, Ports.getUiSettings flags
|
, Ports.getUiSettings flags
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user