Fix: use state param with oauth (#8636)

This commit is contained in:
shamoon
2025-01-07 19:48:36 -08:00
committed by GitHub
parent 0ab21b6fc5
commit a899ff16e3
4 changed files with 65 additions and 6 deletions

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