mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-11-30 02:08:37 +08:00
feat: configurable invite expiry time (#1573)
This commit is contained in:
parent
7cda3fe85b
commit
d0456d0f42
@ -60,7 +60,8 @@ DEFAULTS = {
|
||||
'UPLOAD_FILE_BATCH_LIMIT': 5,
|
||||
'UPLOAD_IMAGE_FILE_SIZE_LIMIT': 10,
|
||||
'OUTPUT_MODERATION_BUFFER_SIZE': 300,
|
||||
'MULTIMODAL_SEND_IMAGE_FORMAT': 'base64'
|
||||
'MULTIMODAL_SEND_IMAGE_FORMAT': 'base64',
|
||||
'INVITE_EXPIRY_HOURS': 72
|
||||
}
|
||||
|
||||
|
||||
@ -218,6 +219,11 @@ class Config:
|
||||
self.MAIL_TYPE = get_env('MAIL_TYPE')
|
||||
self.MAIL_DEFAULT_SEND_FROM = get_env('MAIL_DEFAULT_SEND_FROM')
|
||||
self.RESEND_API_KEY = get_env('RESEND_API_KEY')
|
||||
|
||||
# ------------------------
|
||||
# Workpace Configurations.
|
||||
# ------------------------
|
||||
self.INVITE_EXPIRY_HOURS = int(get_env('INVITE_EXPIRY_HOURS'))
|
||||
|
||||
# ------------------------
|
||||
# Sentry Configurations.
|
||||
|
@ -489,9 +489,10 @@ class RegisterService:
|
||||
'email': account.email,
|
||||
'workspace_id': tenant.id,
|
||||
}
|
||||
expiryHours = current_app.config['INVITE_EXPIRY_HOURS']
|
||||
redis_client.setex(
|
||||
cls._get_invitation_token_key(token),
|
||||
3600,
|
||||
expiryHours * 60 * 60,
|
||||
json.dumps(invitation_data)
|
||||
)
|
||||
return token
|
||||
|
Loading…
Reference in New Issue
Block a user