Skip to content

Commit

Permalink
remove experimental spa routes & point react login to original login api
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsiehgit committed Jul 14, 2023
1 parent 3222a34 commit 7b80483
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 0 additions & 8 deletions static/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2109,14 +2109,6 @@ function buildRoutes() {
</Route>
);

// const experimentalSpaRoutes = EXPERIMENTAL_SPA ? (
// <Route path="/auth/login/" component={errorHandler(AuthLayout)}>
// <IndexRoute component={make(() => import('sentry/views/auth/login'))} />
// <Route path=":orgId/" component={make(() => import('sentry/views/auth/login'))} />
// </Route>
// ) : null;

// const authRoutes = <Route path="/auth/v2/login/" />;
const authRoutes = (
<Route path="/auth/v2/login/" component={errorHandler(AuthLayout)}>
<IndexRoute component={make(() => import('sentry/views/auth/login'))} />
Expand Down
1 change: 1 addition & 0 deletions static/app/views/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class Login extends Component<Props, State> {
onRetry={this.fetchData}
/>
)}
{/* TODO: remove this below - the org page will NOT just be SSO */}
{!loading && authConfig !== null && !error && (
<FormWrapper hasAuthProviders={this.hasAuthProviders}>
{orgId !== undefined && (
Expand Down
9 changes: 9 additions & 0 deletions static/app/views/auth/loginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Button} from 'sentry/components/button';
import SecretField from 'sentry/components/forms/fields/secretField';
import TextField from 'sentry/components/forms/fields/textField';
import Form from 'sentry/components/forms/form';
import FormModel from 'sentry/components/forms/model';
import Link from 'sentry/components/links/link';
import {IconGithub, IconGoogle, IconVsts} from 'sentry/icons';
import {t} from 'sentry/locale';
Expand Down Expand Up @@ -56,6 +57,12 @@ function LoginForm({authConfig}: Props) {

const {githubLoginLink, vstsLoginLink} = authConfig;
const hasLoginProvider = !!(githubLoginLink || vstsLoginLink);
/**
* Org options here allow us to point the form request to either the new api or the
* original login api
* (gets passed down the form model to the client that sends the request)
*/
const form = new FormModel({apiOptions: {baseUrl: ''}});

return (
<FormWrapper hasLoginProvider={hasLoginProvider}>
Expand Down Expand Up @@ -89,6 +96,8 @@ function LoginForm({authConfig}: Props) {
{t('Lost your password?')}
</LostPasswordLink>
}
// NOTE: passing form model in allows us to specify the base url (should we hit /api/0/... or hit the original api endpoints)
model={form}
>
{error && <Alert type="error">{error}</Alert>}
<TextField
Expand Down

0 comments on commit 7b80483

Please sign in to comment.