Jelajahi Sumber

Merge pull request #31416 from overleaf/jel-saml-session-missing

[web] Throw instance of `SAMLAuthenticationError` when missing session data and show error message

GitOrigin-RevId: e64ec571a127367a27eb032bd4a22c90124e8b0f
Jessica Lawshe 5 bulan lalu
induk
melakukan
00fe0473c5
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      services/web/app/src/Features/Errors/Errors.js

+ 7 - 0
services/web/app/src/Features/Errors/Errors.js

@@ -221,6 +221,12 @@ class SAMLGroupMemberLimitReachedError extends OError {}
 
 
 class SAMLDomainCaptureManagedOptInUserMissingEmailError extends SAMLDomainCaptureError {}
 class SAMLDomainCaptureManagedOptInUserMissingEmailError extends SAMLDomainCaptureError {}
 
 
+class SAMLSessionProviderDataMissing extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'try_again'
+  }
+}
+
 class SAMLSessionDataMissing extends BackwardCompatibleError {
 class SAMLSessionDataMissing extends BackwardCompatibleError {
   constructor(arg) {
   constructor(arg) {
     super(arg)
     super(arg)
@@ -390,6 +396,7 @@ module.exports = {
   SAMLEmailNotAffiliatedError,
   SAMLEmailNotAffiliatedError,
   SAMLEmailAffiliatedWithAnotherInstitutionError,
   SAMLEmailAffiliatedWithAnotherInstitutionError,
   SAMLSessionDataMissing,
   SAMLSessionDataMissing,
+  SAMLSessionProviderDataMissing,
   SAMLAuthenticationError,
   SAMLAuthenticationError,
   SAMLGroupSSOLoginIdentityMismatchError,
   SAMLGroupSSOLoginIdentityMismatchError,
   SAMLGroupSSOLoginIdentityNotFoundError,
   SAMLGroupSSOLoginIdentityNotFoundError,