[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:
Nikhil 2024-05-17 19:39:40 +05:30 committed by GitHub
parent 6f05ec7e74
commit cbca2c78ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"