mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
[WEB - 1370] dev: remove session save and add callback for providers (#4506)
* dev: remove session save and add callback for providers * dev: make session save every request as env variable
This commit is contained in:
parent
6f05ec7e74
commit
cbca2c78ee
@ -5,7 +5,7 @@ class CredentialAdapter(Adapter):
|
||||
"""Common interface for all credential providers"""
|
||||
|
||||
def __init__(self, request, provider, callback=None):
|
||||
super().__init__(request, provider, callback)
|
||||
super().__init__(request=request, provider=provider, callback=callback)
|
||||
self.request = request
|
||||
self.provider = provider
|
||||
|
||||
|
@ -25,7 +25,7 @@ class OauthAdapter(Adapter):
|
||||
code=None,
|
||||
callback=None,
|
||||
):
|
||||
super().__init__(request, provider, callback=callback)
|
||||
super().__init__(request=request, provider=provider, callback=callback)
|
||||
self.client_id = client_id
|
||||
self.scope = scope
|
||||
self.redirect_uri = redirect_uri
|
||||
|
@ -23,7 +23,9 @@ class EmailProvider(CredentialAdapter):
|
||||
is_signup=False,
|
||||
callback=None,
|
||||
):
|
||||
super().__init__(request, self.provider)
|
||||
super().__init__(
|
||||
request=request, provider=self.provider, callback=callback
|
||||
)
|
||||
self.key = key
|
||||
self.code = code
|
||||
self.is_signup = is_signup
|
||||
|
@ -59,7 +59,9 @@ class MagicCodeProvider(CredentialAdapter):
|
||||
payload={"email": str(self.key)},
|
||||
)
|
||||
|
||||
super().__init__(request, self.provider)
|
||||
super().__init__(
|
||||
request=request, provider=self.provider, callback=callback
|
||||
)
|
||||
self.key = key
|
||||
self.code = code
|
||||
|
||||
|
@ -331,7 +331,9 @@ SESSION_ENGINE = "plane.db.models.session"
|
||||
SESSION_COOKIE_AGE = os.environ.get("SESSION_COOKIE_AGE", 604800)
|
||||
SESSION_COOKIE_NAME = "plane-session-id"
|
||||
SESSION_COOKIE_DOMAIN = os.environ.get("COOKIE_DOMAIN", None)
|
||||
SESSION_SAVE_EVERY_REQUEST = True
|
||||
SESSION_SAVE_EVERY_REQUEST = (
|
||||
os.environ.get("SESSION_SAVE_EVERY_REQUEST", "0") == "1"
|
||||
)
|
||||
|
||||
# Admin Cookie
|
||||
ADMIN_SESSION_COOKIE_NAME = "plane-admin-session-id"
|
||||
|
Loading…
Reference in New Issue
Block a user