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:
parent
fa9bf16092
commit
602b9a0dbd
4 changed files with 9 additions and 11 deletions
|
@ -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 />} />
|
||||
|
|
|
@ -23,7 +23,7 @@ const useSocialCallbackHandler = () => {
|
|||
// Web flow
|
||||
navigate(
|
||||
{
|
||||
pathname: `/social/sign-in-callback/${connectorId}`,
|
||||
pathname: `/sign-in/social/${connectorId}`,
|
||||
search,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}, []);
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue