Skip to content

Commit

Permalink
RPX authentication: don't store credentials in user file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Apr 1, 2011
1 parent fbaedc2 commit 6d182e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Network/Gitit/Authentication.hs
Expand Up @@ -41,6 +41,7 @@ import Control.Monad.Trans (MonadIO(), liftIO)
import System.Exit
import System.Log.Logger (logM, Priority(..))
import Data.Char (isAlphaNum, isAlpha, isAscii)
import qualified Data.Map as M
import Text.Pandoc.Shared (substitute)
import Data.Maybe (isJust, fromJust, isNothing, fromMaybe)
import Network.URL (encString, exportURL, add_param, importURL)
Expand Down Expand Up @@ -466,10 +467,10 @@ loginRPXUser params = do
-- so we use it if present.
let userId = R.userIdentifier uid
let email = prop "verifiedEmail" uid
user <- liftIO $ mkUser (fromMaybe userId email) (fromMaybe "" email) "none"
updateGititState $ \s -> s { users = M.insert userId user (users s) }
key <- newSession (SessionData userId)
addCookie (sessionTimeout cfg) (mkCookie "sid" (show key))
user <- liftIO $ mkUser (fromMaybe userId email) (fromMaybe "" email) "none"
addUser userId user
see $ fromJust $ rDestination params
where
prop pname info = lookup pname $ R.userData info
Expand Down

0 comments on commit 6d182e6

Please sign in to comment.