Fix: use state param with oauth (#8636)

This commit is contained in:
shamoon authored and GitHub committed 2025-01-08 03:48:36 +00:00
1 parent 0ab21b6fc5
commit a899ff16e3
4 files changed
+65 -6

No files matched your search

+2
View File
@@ -1717,10 +1717,12 @@ class UiSettingsView(GenericAPIView):
manager = PaperlessMailOAuth2Manager()
if settings.GMAIL_OAUTH_ENABLED:
ui_settings["gmail_oauth_url"] = manager.get_gmail_authorization_url()
request.session["oauth_state"] = manager.state
if settings.OUTLOOK_OAUTH_ENABLED:
ui_settings["outlook_oauth_url"] = (
manager.get_outlook_authorization_url()
)
request.session["oauth_state"] = manager.state
ui_settings["email_enabled"] = settings.EMAIL_ENABLED