Compare commits
No commits in common. "d2f1b079224152e165a8089d1731beabd123034d" and "cbcf23e316f6c2f410c15037648d3c19cc20847b" have entirely different histories.
d2f1b07922
...
cbcf23e316
|
@ -137,13 +137,6 @@ deleteExpiredEmails time = runQuery $ delete $ do
|
||||||
verification <- from $ table @DBEmailVerification
|
verification <- from $ table @DBEmailVerification
|
||||||
where_ $ verification ^. DBEmailVerificationExpires <=. val time
|
where_ $ verification ^. DBEmailVerificationExpires <=. val time
|
||||||
|
|
||||||
deleteOrphanedVerifications :: MonadDB m => m ()
|
|
||||||
deleteOrphanedVerifications = runQuery $ delete $ do
|
|
||||||
verification <- from $ table @DBEmailVerification
|
|
||||||
where_ $ (==. val (0 :: Int)) $ subSelectCount $ do
|
|
||||||
email <- from $ table @DBEmail
|
|
||||||
where_ $ email ^. DBEmailVid ==. just (verification ^. DBEmailVerificationId)
|
|
||||||
|
|
||||||
deleteUsersWithoutEmail :: MonadDB m => m ()
|
deleteUsersWithoutEmail :: MonadDB m => m ()
|
||||||
deleteUsersWithoutEmail = runQuery $ delete $ do
|
deleteUsersWithoutEmail = runQuery $ delete $ do
|
||||||
user <- from $ table @DBUser
|
user <- from $ table @DBUser
|
||||||
|
|
|
@ -19,11 +19,20 @@ import Datarekisteri.Core.Types
|
||||||
import Data.Aeson (ToJSON(..), FromJSON(..))
|
import Data.Aeson (ToJSON(..), FromJSON(..))
|
||||||
import Data.ByteArray (ByteArray, ByteArrayAccess)
|
import Data.ByteArray (ByteArray, ByteArrayAccess)
|
||||||
import Data.Morpheus.App.Internal.Resolving (Resolver, LiftOperation)
|
import Data.Morpheus.App.Internal.Resolving (Resolver, LiftOperation)
|
||||||
import Data.Morpheus.Types (MonadError, GQLError)
|
import Data.Morpheus.Server.Types (SCALAR)
|
||||||
import Data.Time (getCurrentTime)
|
import Data.Morpheus.Types (GQLType, DecodeScalar(..), KIND, EncodeScalar(..),
|
||||||
|
ScalarValue(..), MonadError, GQLError)
|
||||||
|
import Data.Morpheus.Types.GQLScalar (scalarToJSON, scalarFromJSON)
|
||||||
|
import Data.Time (UTCTime, getCurrentTime, NominalDiffTime, addUTCTime, Day)
|
||||||
|
import Data.Time.Format.ISO8601 (iso8601Show, iso8601ParseM)
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import Data.Char (isSpace)
|
||||||
import Database.Persist.Class (PersistField(..))
|
import Database.Persist.Class (PersistField(..))
|
||||||
|
import Database.Persist.PersistValue (PersistValue(..))
|
||||||
import Database.Persist.Sql (PersistFieldSql(..), SqlBackend)
|
import Database.Persist.Sql (PersistFieldSql(..), SqlBackend)
|
||||||
import Network.Mail.Mime (Mail, Address(..))
|
import Network.Mail.Mime (Mail, Address(..))
|
||||||
|
import Text.Email.Validate (EmailAddress, toByteString, validate, emailAddress)
|
||||||
|
import qualified "base64" Data.ByteString.Base64 as B64 (encodeBase64, decodeBase64)
|
||||||
import "cryptonite" Crypto.Random (MonadRandom(..))
|
import "cryptonite" Crypto.Random (MonadRandom(..))
|
||||||
|
|
||||||
forward :: Monad m => [a] -> m [Maybe a]
|
forward :: Monad m => [a] -> m [Maybe a]
|
||||||
|
|
|
@ -58,7 +58,6 @@ gcEmailsMain :: CLIM ()
|
||||||
gcEmailsMain = do
|
gcEmailsMain = do
|
||||||
time <- currentTime
|
time <- currentTime
|
||||||
deleteExpiredEmails time
|
deleteExpiredEmails time
|
||||||
deleteOrphanedVerifications
|
|
||||||
|
|
||||||
gcApplicationsMain :: CLIM ()
|
gcApplicationsMain :: CLIM ()
|
||||||
gcApplicationsMain = do
|
gcApplicationsMain = do
|
||||||
|
|
|
@ -204,9 +204,6 @@ instance Yesod DataIdClient where
|
||||||
--bg-colour: #ffffff;
|
--bg-colour: #ffffff;
|
||||||
--fg-colour: #181c22;
|
--fg-colour: #181c22;
|
||||||
}
|
}
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
html {
|
html {
|
||||||
font-family: "Fira Sans", sans-serif;
|
font-family: "Fira Sans", sans-serif;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -242,7 +239,7 @@ instance Yesod DataIdClient where
|
||||||
margin-bottom: 0.3em;
|
margin-bottom: 0.3em;
|
||||||
}
|
}
|
||||||
form {
|
form {
|
||||||
max-width: min(30em,100%);
|
max-width: 20em;
|
||||||
}
|
}
|
||||||
summary > h2 {
|
summary > h2 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -333,7 +330,6 @@ instance Yesod DataIdClient where
|
||||||
$doctype 5
|
$doctype 5
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
||||||
<title>#{pageTitle p}
|
<title>#{pageTitle p}
|
||||||
^{pageHead p}
|
^{pageHead p}
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in New Issue