diff --git a/shell.nix b/shell.nix index 8c3f8b97e..7b3fd32e9 100644 --- a/shell.nix +++ b/shell.nix @@ -9,7 +9,8 @@ let haskellPackages = pkgs.haskellPackages; - oauth2Flake = (builtins.getFlake "git+https://gitlab.uniworx.de/mosbach/oauth2-mock-server/?rev=d47908b4f7883b4b485abf1ee06645495ccdc7b3&ref=user-queries").packages.x86_64-linux; + oauth2Flake = (builtins.getFlake "git+https://gitlab.uniworx.de/mosbach/oauth2-mock-server/?rev=45debf40cd171f78a4de38f608a6cfd3be73b91a&ref=oidc").packages.x86_64-linux; + oauth2MockServer = oauth2Flake.default; mkOauth2DB = oauth2Flake.mkOauth2DB; diff --git a/src/Foundation/Instances.hs b/src/Foundation/Instances.hs index 20d10b2de..49b6b5de9 100644 --- a/src/Foundation/Instances.hs +++ b/src/Foundation/Instances.hs @@ -42,6 +42,8 @@ import Foundation.DB import Network.Wai.Parse (lbsBackEnd) +import System.Environment (lookupEnv) + import UnliftIO.Pool (withResource) import qualified Control.Monad.State.Class as State @@ -136,6 +138,12 @@ instance YesodAuth UniWorX where plugins <- getsYesod authPlugins $logDebugS "Auth" $ "Enabled plugins: " <> Text.intercalate ", " (map apName plugins) +#ifdef DEVELOPMENT + mPort <- liftIO $ lookupEnv "OAUTH2_SERVER_PORT" +#else + let mPort = Nothing +#endif + setTitleI MsgLoginTitle $(widgetFile "login") diff --git a/templates/login.hamlet b/templates/login.hamlet index bb3ee704e..e5dc2706f 100644 --- a/templates/login.hamlet +++ b/templates/login.hamlet @@ -1,6 +1,6 @@ $newline never -$# SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,David Mosbach +$# SPDX-FileCopyrightText: 2022-2024 Gregor Kleen , David Mosbach $# $# SPDX-License-Identifier: AGPL-3.0-or-later @@ -26,3 +26,8 @@ $forall AuthPlugin{apName, apLogin} <- plugins

_{MsgDummyLoginTitle} ^{apLogin toParent} +$maybe port <- mPort +
+

SSO Dev Test + Test login via single sign-on +