mirror of
https://code.sup39.dev/repos/Wqawg
synced 2025-03-20 04:46:22 +09:00
Support bypassing email verification of new users
This commit is contained in:
parent
c41f1183e0
commit
78b5bad2c4
4 changed files with 11 additions and 1 deletions
src/Vervis
|
@ -541,6 +541,7 @@ instance YesodAuthVerify App where
|
|||
verificationRoute _ = ResendVerifyEmailR
|
||||
|
||||
instance YesodAuthAccount AccountPersistDB' App where
|
||||
requireEmailVerification = appEmailVerification . appSettings
|
||||
emailVerifyKeyDuration _ = Just $ fromTimeUnit (1 :: Day)
|
||||
passphraseResetKeyDuration _ = Just $ fromTimeUnit (1 :: Day)
|
||||
allowLoginByEmailAddress _ = True
|
||||
|
|
|
@ -108,6 +108,9 @@ data AppSettings = AppSettings
|
|||
, appRegister :: Bool
|
||||
-- | The maximal number of user accounts that can be registered.
|
||||
, appAccounts :: Maybe Int
|
||||
-- | Whether to send verification email to new users. If not, users will
|
||||
-- be instantly considered verified, without sending email.
|
||||
, appEmailVerification :: Bool
|
||||
-- | SMTP server details for sending email, and other email related
|
||||
-- details. If set to 'Nothing', no email will be sent.
|
||||
, appMail :: Maybe MailSettings
|
||||
|
@ -171,6 +174,7 @@ instance FromJSON AppSettings where
|
|||
appSshKeyFile <- o .: "ssh-key-file"
|
||||
appRegister <- o .: "registration"
|
||||
appAccounts <- o .: "max-accounts"
|
||||
appEmailVerification <- o .:? "email-verification" .!= not defaultDev
|
||||
appMail <- o .:? "mail"
|
||||
|
||||
appCapabilitySigningKeyFile <- o .: "capability-signing-key"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue