Check decryption before redirecting (as was intended)

This commit is contained in:
Gregor Kleen 2018-01-14 01:37:01 +01:00
parent db92528884
commit 6bf0f321cf

View File

@ -20,12 +20,18 @@ import Import hiding (Proxy)
import Data.Proxy
import qualified Data.UUID.Cryptographic as UUID
class KnownSymbol namespace => CryptoRoute ciphertext namespace where
cryptoIDRoute :: CryptoID namespace ciphertext -> Handler (Route UniWorX)
instance CryptoRoute UUID "Submission" where
cryptoIDRoute = return . SubmissionR
cryptoIDRoute cID = do
cIDKey <- getsYesod appCryptoIDKey
sId <- UUID.decrypt cIDKey cID
return $ SubmissionR cID
class Dispatch ciphertext (x :: [Symbol]) where