Browse Source

fix(ui): Make back button work on auth settings (#33438)

Evan Purkhiser 2 years ago
parent
commit
2b93e3ad97
1 changed files with 6 additions and 1 deletions
  1. 6 1
      static/app/views/settings/organizationAuth/index.tsx

+ 6 - 1
static/app/views/settings/organizationAuth/index.tsx

@@ -26,7 +26,12 @@ class OrganizationAuth extends AsyncView<Props, State> {
     if (nextState.provider && access.includes('org:write')) {
       // If SSO provider is configured, keep showing loading while we redirect
       // to django configuration view
-      window.location.assign(`/organizations/${this.props.params.orgId}/auth/configure/`);
+      const path = `/organizations/${this.props.params.orgId}/auth/configure/`;
+
+      // Don't break the back button by first replacing the current history
+      // state so pressing back skips this react view.
+      this.props.router.replace(path);
+      window.location.assign(path);
     }
   }