Skip to content

Commit bfeecdd

Browse files
committed
update
1 parent f1e4985 commit bfeecdd

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

dojo/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def process_exception(self, request, exception):
9595
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE["SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN"])
9696
return redirect("/login?force_login_form")
9797
if isinstance(exception, AuthTokenError):
98-
messages.error(request, "Social login failed due to an invalid or expired token. Please try again or use the standard login.")
98+
messages.error(request, settings.SOCIAL_AUTH_EXCEPTION_MESSAGE["SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR"])
9999
return redirect("/login?force_login_form")
100100
if isinstance(exception, TypeError) and "'NoneType' object is not iterable" in str(exception):
101101
logger.warning("OIDC login error: NoneType is not iterable")

dojo/settings/settings.dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED=(str, "Social login failed. Please try again or use the standard login."),
180180
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN=(str, "You are not authorized to log in via this method. Please contact support or use the standard login."),
181181
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE=(str, "An unexpected error occurred during social login. Please use the standard login."),
182+
DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR=(str, "Social login failed due to an invalid or expired token. Please try again or use the standard login."),
182183
DD_SAML2_ENABLED=(bool, False),
183184
# Allows to override default SAML authentication backend. Check https://djangosaml2.readthedocs.io/contents/setup.html#custom-user-attributes-processing
184185
DD_SAML2_AUTHENTICATION_BACKENDS=(str, "djangosaml2.backends.Saml2Backend"),
@@ -660,6 +661,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
660661
"SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED": env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FAILED"),
661662
"SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN": env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_FORBIDDEN"),
662663
"SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE": env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_NONE_TYPE"),
664+
"SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR": env("DD_SOCIAL_AUTH_EXCEPTION_MESSAGE_AUTH_TOKEN_ERROR"),
663665
}
664666

665667
AUTH0_OAUTH2_ENABLED = env("DD_SOCIAL_AUTH_AUTH0_OAUTH2_ENABLED")

0 commit comments

Comments
 (0)