chore(login): use correct auth plugin identifiers for comparison in login template
This commit is contained in:
parent
ac5bca2fcd
commit
d1e1f25162
@ -20,6 +20,7 @@ import qualified Yesod.Core.Unsafe as Unsafe
|
||||
import qualified Yesod.Auth.Message as Auth
|
||||
|
||||
import Utils.Form
|
||||
import Auth.OAuth2 (apAzure, apAzureMock)
|
||||
import Auth.LDAP
|
||||
import Auth.PWHash
|
||||
import Auth.Dummy
|
||||
|
||||
@ -50,10 +50,10 @@ authenticate :: ( MonadHandler m, HandlerSite m ~ UniWorX
|
||||
=> Creds UniWorX
|
||||
-> m (AuthenticationResult UniWorX)
|
||||
authenticate creds@Creds{..} = liftHandler . runDB . withReaderT projectBackend $ do
|
||||
$logErrorS "Auth" $ "\a\27[31m" <> tshow creds <> "\27[0m" -- TODO: debug only
|
||||
$logErrorS "Auth Debug" $ "\a\27[31m" <> tshow creds <> "\27[0m" -- TODO: debug only
|
||||
setSessionJson SessionOAuth2Token $ (getAccessToken creds, getRefreshToken creds)
|
||||
sess <- getSession
|
||||
$logErrorS "OAuth" $ "\27[34m" <> tshow sess <> "\27[0m" -- TODO: debug only
|
||||
$logErrorS "OAuth session Debug" $ "\27[34m" <> tshow sess <> "\27[0m" -- TODO: debug only
|
||||
|
||||
now <- liftIO getCurrentTime
|
||||
userAuthConf <- getsYesod $ view _appUserAuthConf
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
$newline never
|
||||
|
||||
$# SPDX-FileCopyrightText: 2022-2024 Gregor Kleen <gregor.kleen@ifi.lmu.de>,David Mosbach <david.mosbach@uniworx.de>
|
||||
$# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>, David Mosbach <david.mosbach@uniworx.de>
|
||||
$#
|
||||
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
$forall AuthPlugin{apName, apLogin} <- plugins
|
||||
$if apName == "azureadv2"
|
||||
$if apName == apAzure
|
||||
<section>
|
||||
<h2>Azure
|
||||
^{apLogin toParent}
|
||||
$elseif apName == "dev-oauth2-mock"
|
||||
$elseif apName == apAzureMock
|
||||
<section>
|
||||
<h2>_{MsgDummyLoginTitle}
|
||||
^{apLogin toParent}
|
||||
$elseif apName == "LDAP"
|
||||
$elseif apName == apLdap
|
||||
<section>
|
||||
<h2>_{MsgLDAPLoginTitle}
|
||||
^{apLogin toParent}
|
||||
$elseif apName == "PWHash"
|
||||
$elseif apName == apHash
|
||||
<section>
|
||||
<h2>_{MsgPWHashLoginTitle}
|
||||
<p>_{MsgPWHashLoginNote}
|
||||
^{apLogin toParent}
|
||||
$elseif apName == "dummy"
|
||||
$elseif apName == apDummy
|
||||
<section>
|
||||
<h2>_{MsgDummyLoginTitle}
|
||||
^{apLogin toParent}
|
||||
|
||||
Reference in New Issue
Block a user