0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

refactor(ui): refactor sign-social-call path name (#1931)

align with the sign-in page's other path pattern
This commit is contained in:
simeng-li 2022-09-15 15:55:35 +08:00 committed by GitHub
parent fa9bf16092
commit 602b9a0dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View file

@ -15,7 +15,7 @@ import SecondarySignIn from './pages/SecondarySignIn';
import SignIn from './pages/SignIn';
import SocialLanding from './pages/SocialLanding';
import SocialRegister from './pages/SocialRegister';
import SocialSignInCallback from './pages/SocialSignInCallback';
import SocialSignIn from './pages/SocialSignInCallback';
import getSignInExperienceSettings from './utils/sign-in-experience';
import './scss/normalized.scss';
@ -58,15 +58,13 @@ const App = () => {
<Route element={<LoadingLayerProvider />}>
<Route path="/sign-in" element={<SignIn />} />
<Route path="/sign-in/social/:connector" element={<SocialSignIn />} />
<Route path="/sign-in/:method" element={<SecondarySignIn />} />
<Route path="/register" element={<Register />} />
<Route path="/register/:method" element={<Register />} />
{/* social sign-in pages */}
<Route
path="/social/sign-in-callback/:connector"
element={<SocialSignInCallback />}
/>
<Route path="/callback/:connector" element={<Callback />} />
<Route path="/social/register/:connector" element={<SocialRegister />} />
<Route path="/social/landing/:connector" element={<SocialLanding />} />

View file

@ -23,7 +23,7 @@ const useSocialCallbackHandler = () => {
// Web flow
navigate(
{
pathname: `/social/sign-in-callback/${connectorId}`,
pathname: `/sign-in/social/${connectorId}`,
search,
},
{

View file

@ -24,7 +24,7 @@ const useSocial = () => {
: redirectTo;
getLogtoNativeSdk()?.getPostMessage()({
callbackUri: `${window.location.origin}/social/sign-in-callback/${connectorId}`,
callbackUri: `${window.location.origin}/sign-in/social/${connectorId}`,
redirectTo: redirectUri,
});
}, []);

View file

@ -23,9 +23,9 @@ describe('SocialCallbackPage with code', () => {
Object.defineProperty(window, 'location', {
value: {
origin,
href: `/social/sign-in-callback?state=${state}&code=foo`,
href: `/sign-in/social/github?state=${state}&code=foo`,
search: `?state=${state}&code=foo`,
pathname: '/social/sign-in-callback',
pathname: '/sign-in/social',
replace: jest.fn(),
},
});
@ -33,9 +33,9 @@ describe('SocialCallbackPage with code', () => {
renderWithPageContext(
<SettingsProvider>
<MemoryRouter initialEntries={['/social/sign-in-callback/github']}>
<MemoryRouter initialEntries={['/sign-in/social/github']}>
<Routes>
<Route path="/social/sign-in-callback/:connector" element={<SocialCallback />} />
<Route path="/sign-in/social/:connector" element={<SocialCallback />} />
</Routes>
</MemoryRouter>
</SettingsProvider>