remote_billing: Add redirects to login for unauthed user in legacy flow.

Analogical to the more complex mechanism implemented for the RemoteRealm
flow in a previous commit in
authenticated_remote_realm_management_endpoint.

As explained in the code comment, this is much easier because:

In this flow, we can only redirect to our local "legacy server flow
login" page. That means that we can do it universally whether the user
has an expired
identity_dict, or just lacks any form of authentication info at all -
there are no security concerns since this is just a local redirect.
This commit is contained in:
Mateusz Mandera
2023-12-03 02:58:02 +01:00
committed by Tim Abbott
parent 44ac99b8fc
commit 134e3bfa68
3 changed files with 54 additions and 24 deletions

View File

@@ -137,7 +137,7 @@ def get_remote_server_from_session(
)
if identity_dict is None:
raise JsonableError(_("User not authenticated"))
raise RemoteBillingAuthenticationError
remote_server_uuid = identity_dict["remote_server_uuid"]
try: