Merge branch 'reset-pass-query' into 'develop'

Preserve password reset URL query

See merge request soapbox-pub/soapbox-fe!1506
chats-fixes
Alex Gleason 2022-06-08 15:36:33 +00:00
commit b85ac4c50a
2 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { Link, Redirect, Route, Switch, useHistory } from 'react-router-dom';
import { Link, Redirect, Route, Switch, useHistory, useLocation } from 'react-router-dom';
import LandingGradient from 'soapbox/components/landing-gradient';
import SiteLogo from 'soapbox/components/site-logo';
@ -23,6 +23,7 @@ const messages = defineMessages({
const AuthLayout = () => {
const intl = useIntl();
const history = useHistory();
const { search } = useLocation();
const siteTitle = useAppSelector(state => state.instance.title);
const soapboxConfig = useSoapboxConfig();
@ -76,7 +77,7 @@ const AuthLayout = () => {
<Route path='/invite/:token' component={RegisterInvite} />
<Redirect from='/auth/password/new' to='/reset-password' />
<Redirect from='/auth/password/edit' to='/edit-password' />
<Redirect from='/auth/password/edit' to={`/edit-password${search}`} />
</Switch>
</CardBody>
</Card>

Wyświetl plik

@ -5,7 +5,7 @@ import React, { useState, useEffect, useRef, useCallback } from 'react';
import { HotKeys } from 'react-hotkeys';
import { defineMessages, useIntl } from 'react-intl';
import { useDispatch } from 'react-redux';
import { Switch, useHistory, matchPath, Redirect } from 'react-router-dom';
import { Switch, useHistory, useLocation, matchPath, Redirect } from 'react-router-dom';
import { fetchFollowRequests } from 'soapbox/actions/accounts';
import { fetchReports, fetchUsers, fetchConfig } from 'soapbox/actions/admin';
@ -156,8 +156,8 @@ const keyMap = {
};
const SwitchingColumnsArea: React.FC = ({ children }) => {
const history = useHistory();
const features = useFeatures();
const { search } = useLocation();
const { authenticatedProfile, cryptoAddresses } = useSoapboxConfig();
const hasCrypto = cryptoAddresses.size > 0;
@ -232,7 +232,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
<Redirect from='/settings/otp_authentication' to='/settings/mfa' />
<Redirect from='/settings/applications' to='/developers' />
<Redirect from='/auth/edit' to='/settings' />
<Redirect from='/auth/confirmation' to={`/email-confirmation${history.location.search}`} />
<Redirect from='/auth/confirmation' to={`/email-confirmation${search}`} />
<Redirect from='/auth/reset_password' to='/reset-password' />
<Redirect from='/auth/edit_password' to='/edit-password' />
<Redirect from='/auth/sign_in' to='/login' />
@ -247,7 +247,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
<Redirect from='/auth/external' to='/login/external' />
<Redirect from='/auth/mfa' to='/settings/mfa' />
<Redirect from='/auth/password/new' to='/reset-password' />
<Redirect from='/auth/password/edit' to='/edit-password' />
<Redirect from='/auth/password/edit' to={`/edit-password${search}`} />
<WrappedRoute path='/tags/:id' publicRoute page={DefaultPage} component={HashtagTimeline} content={children} />