Move Edit Password into the UI

This commit is contained in:
Alex Gleason 2023-09-20 14:19:03 -05:00
parent 68bdcd30de
commit 977d908db0
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 5 additions and 8 deletions

View File

@ -104,7 +104,6 @@ const SoapboxMount = () => {
<Route exact path='/' component={PublicLayout} /> <Route exact path='/' component={PublicLayout} />
)} )}
<Route path='/edit-password' component={AuthLayout} />
<Route path='/invite/:token' component={AuthLayout} /> <Route path='/invite/:token' component={AuthLayout} />
<Route path='/' component={UI} /> <Route path='/' component={UI} />

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import { Link, Redirect, Route, Switch, useHistory, useLocation } from 'react-router-dom'; import { Link, Redirect, Route, Switch, useHistory } from 'react-router-dom';
import LandingGradient from 'soapbox/components/landing-gradient'; import LandingGradient from 'soapbox/components/landing-gradient';
import SiteLogo from 'soapbox/components/site-logo'; import SiteLogo from 'soapbox/components/site-logo';
@ -8,7 +8,6 @@ import { useOwnAccount, useInstance, useRegistrationStatus } from 'soapbox/hooks
import { Button, Card, CardBody } from '../../components/ui'; import { Button, Card, CardBody } from '../../components/ui';
import LoginPage from '../auth-login/components/login-page'; import LoginPage from '../auth-login/components/login-page';
import PasswordResetConfirm from '../auth-login/components/password-reset-confirm';
import ExternalLoginForm from '../external-login/components/external-login-form'; import ExternalLoginForm from '../external-login/components/external-login-form';
import Footer from '../public-layout/components/footer'; import Footer from '../public-layout/components/footer';
import RegisterInvite from '../register-invite'; import RegisterInvite from '../register-invite';
@ -20,7 +19,6 @@ const messages = defineMessages({
const AuthLayout = () => { const AuthLayout = () => {
const intl = useIntl(); const intl = useIntl();
const history = useHistory(); const history = useHistory();
const { search } = useLocation();
const { account } = useOwnAccount(); const { account } = useOwnAccount();
const instance = useInstance(); const instance = useInstance();
@ -63,11 +61,7 @@ const AuthLayout = () => {
<Route exact path='/login/external' component={ExternalLoginForm} /> <Route exact path='/login/external' component={ExternalLoginForm} />
<Route exact path='/login/add' component={LoginPage} /> <Route exact path='/login/add' component={LoginPage} />
<Route exact path='/edit-password' component={PasswordResetConfirm} />
<Route path='/invite/:token' component={RegisterInvite} /> <Route path='/invite/:token' component={RegisterInvite} />
<Redirect from='/auth/password/new' to='/reset-password' />
<Redirect from='/auth/password/edit' to={`/edit-password${search}`} />
</Switch> </Switch>
</CardBody> </CardBody>
</Card> </Card>

View File

@ -136,6 +136,7 @@ import {
RegistrationPage, RegistrationPage,
LoginPage, LoginPage,
PasswordReset, PasswordReset,
PasswordResetConfirm,
} from './util/async-components'; } from './util/async-components';
import GlobalHotkeys from './util/global-hotkeys'; import GlobalHotkeys from './util/global-hotkeys';
import { WrappedRoute } from './util/react-router-helpers'; import { WrappedRoute } from './util/react-router-helpers';
@ -361,6 +362,9 @@ const SwitchingColumnsArea: React.FC<ISwitchingColumnsArea> = ({ children }) =>
<WrappedRoute path='/login' page={DefaultPage} component={LoginPage} publicRoute exact /> <WrappedRoute path='/login' page={DefaultPage} component={LoginPage} publicRoute exact />
<WrappedRoute path='/reset-password' page={DefaultPage} component={PasswordReset} publicRoute exact /> <WrappedRoute path='/reset-password' page={DefaultPage} component={PasswordReset} publicRoute exact />
<WrappedRoute path='/edit-password' page={DefaultPage} component={PasswordResetConfirm} publicRoute exact />
<Redirect from='/auth/password/new' to='/reset-password' />
<Redirect from='/auth/password/edit' to={`/edit-password${search}`} />
<WrappedRoute page={EmptyPage} component={GenericNotFound} content={children} /> <WrappedRoute page={EmptyPage} component={GenericNotFound} content={children} />
</Switch> </Switch>