mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -06:00
Add campaign tags to the logoff link
CURA-8441
This commit is contained in:
parent
57e66a5796
commit
5bf24ed678
1 changed files with 5 additions and 4 deletions
|
@ -24,7 +24,7 @@ if TYPE_CHECKING:
|
||||||
from cura.OAuth2.Models import UserProfile, OAuth2Settings
|
from cura.OAuth2.Models import UserProfile, OAuth2Settings
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
|
|
||||||
MYCLOUD_LOGOFF_URL = "https://account.ultimaker.com/logoff"
|
MYCLOUD_LOGOFF_URL = "https://account.ultimaker.com/logoff?utm_source=cura&utm_medium=software&utm_campaign=change-account-before-adding-printers"
|
||||||
|
|
||||||
class AuthorizationService:
|
class AuthorizationService:
|
||||||
"""The authorization service is responsible for handling the login flow, storing user credentials and providing
|
"""The authorization service is responsible for handling the login flow, storing user credentials and providing
|
||||||
|
@ -209,10 +209,11 @@ class AuthorizationService:
|
||||||
link to force the a browser logout from mycloud.ultimaker.com
|
link to force the a browser logout from mycloud.ultimaker.com
|
||||||
:return: The authentication URL, properly formatted and encoded
|
:return: The authentication URL, properly formatted and encoded
|
||||||
"""
|
"""
|
||||||
auth_url = "{}?{}".format(self._auth_url, urlencode(query_parameters_dict))
|
auth_url = f"{self._auth_url}?{urlencode(query_parameters_dict)}"
|
||||||
if force_browser_logout:
|
if force_browser_logout:
|
||||||
# The url after '?next=' should be urlencoded
|
connecting_char = "&" if "?" in MYCLOUD_LOGOFF_URL else "?"
|
||||||
auth_url = "{}?next={}".format(MYCLOUD_LOGOFF_URL, quote_plus(auth_url))
|
# The url after 'next=' should be urlencoded
|
||||||
|
auth_url = f"{MYCLOUD_LOGOFF_URL}{connecting_char}next={quote_plus(auth_url)}"
|
||||||
return auth_url
|
return auth_url
|
||||||
|
|
||||||
def _onAuthStateChanged(self, auth_response: AuthenticationResponse) -> None:
|
def _onAuthStateChanged(self, auth_response: AuthenticationResponse) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue