mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Merge branch 'main' into 1682-update-remaining-outdated-npm-dependencies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from flask import abort, has_request_context, request
|
||||
from flask import abort, current_app, has_request_context, request
|
||||
from flask_login import current_user
|
||||
from notifications_python_client import __version__
|
||||
from notifications_python_client.base import BaseAPIClient
|
||||
@@ -65,8 +65,13 @@ class NotifyAdminAPIClient(BaseAPIClient):
|
||||
or "user/email" in arg
|
||||
or "/activate" in arg
|
||||
or "/email-code" in arg
|
||||
or "/verify/code" in arg
|
||||
):
|
||||
still_signing_in = True
|
||||
|
||||
# This seems to be a weird edge case that happens intermittently with invites
|
||||
if str(arg) == "()":
|
||||
still_signing_in = True
|
||||
# TODO: Update this once E2E tests are managed by a feature flag or some other main config option.
|
||||
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):
|
||||
# allow end-to-end tests to skip check
|
||||
@@ -75,6 +80,7 @@ class NotifyAdminAPIClient(BaseAPIClient):
|
||||
# we are not full signed in yet
|
||||
pass
|
||||
elif not current_user or not current_user.is_active:
|
||||
current_app.logger.error(f"Unauthorized URL #notify-compliance-46 {args}")
|
||||
abort(403)
|
||||
|
||||
def post(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user