Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
d0456d0f
Unverified
Commit
d0456d0f
authored
Nov 21, 2023
by
Matri
Committed by
GitHub
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: configurable invite expiry time (#1573)
parent
7cda3fe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
config.py
api/config.py
+7
-1
account_service.py
api/services/account_service.py
+2
-1
No files found.
api/config.py
View file @
d0456d0f
...
...
@@ -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.
...
...
api/services/account_service.py
View file @
d0456d0f
...
...
@@ -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
),
360
0
,
expiryHours
*
60
*
6
0
,
json
.
dumps
(
invitation_data
)
)
return
token
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment