chore(login): use correct auth plugin identifiers for comparison in login template

This commit is contained in:
Sarah Vaupel 2024-02-29 17:52:31 +01:00
parent ac5bca2fcd
commit d1e1f25162
3 changed files with 9 additions and 8 deletions

View File

@ -20,6 +20,7 @@ import qualified Yesod.Core.Unsafe as Unsafe
import qualified Yesod.Auth.Message as Auth import qualified Yesod.Auth.Message as Auth
import Utils.Form import Utils.Form
import Auth.OAuth2 (apAzure, apAzureMock)
import Auth.LDAP import Auth.LDAP
import Auth.PWHash import Auth.PWHash
import Auth.Dummy import Auth.Dummy

View File

@ -50,10 +50,10 @@ authenticate :: ( MonadHandler m, HandlerSite m ~ UniWorX
=> Creds UniWorX => Creds UniWorX
-> m (AuthenticationResult UniWorX) -> m (AuthenticationResult UniWorX)
authenticate creds@Creds{..} = liftHandler . runDB . withReaderT projectBackend $ do 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) setSessionJson SessionOAuth2Token $ (getAccessToken creds, getRefreshToken creds)
sess <- getSession 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 now <- liftIO getCurrentTime
userAuthConf <- getsYesod $ view _appUserAuthConf userAuthConf <- getsYesod $ view _appUserAuthConf

View File

@ -1,28 +1,28 @@
$newline never $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 $# SPDX-License-Identifier: AGPL-3.0-or-later
$forall AuthPlugin{apName, apLogin} <- plugins $forall AuthPlugin{apName, apLogin} <- plugins
$if apName == "azureadv2" $if apName == apAzure
<section> <section>
<h2>Azure <h2>Azure
^{apLogin toParent} ^{apLogin toParent}
$elseif apName == "dev-oauth2-mock" $elseif apName == apAzureMock
<section> <section>
<h2>_{MsgDummyLoginTitle} <h2>_{MsgDummyLoginTitle}
^{apLogin toParent} ^{apLogin toParent}
$elseif apName == "LDAP" $elseif apName == apLdap
<section> <section>
<h2>_{MsgLDAPLoginTitle} <h2>_{MsgLDAPLoginTitle}
^{apLogin toParent} ^{apLogin toParent}
$elseif apName == "PWHash" $elseif apName == apHash
<section> <section>
<h2>_{MsgPWHashLoginTitle} <h2>_{MsgPWHashLoginTitle}
<p>_{MsgPWHashLoginNote} <p>_{MsgPWHashLoginNote}
^{apLogin toParent} ^{apLogin toParent}
$elseif apName == "dummy" $elseif apName == apDummy
<section> <section>
<h2>_{MsgDummyLoginTitle} <h2>_{MsgDummyLoginTitle}
^{apLogin toParent} ^{apLogin toParent}