feat: Append qs to the root location when redirect from sign in

This commit is contained in:
Kevin Szuchet 2023-08-09 12:33:11 +02:00
parent 86748fb81c
commit d9e0082ade
No known key found for this signature in database
GPG Key ID: 1E083BC33700E594
2 changed files with 2 additions and 3 deletions

View File

@ -25,7 +25,7 @@ function ConnectToWorld(props: Props) {
useEffect(() => {
if (!loggedInAddress && !isLoading) {
navigate(locations.signIn(locations.root()))
navigate(locations.signIn(locations.root(worldsContentServerUrl)))
}
}, [isLoading, loggedInAddress])

View File

@ -1,6 +1,5 @@
export const locations = {
root: () => '/',
account: (address: string) => `/accounts/${address}`,
root: (worldsContentServerUrl?: string) => '/' + (worldsContentServerUrl ? `?worlds-content-server-url=${worldsContentServerUrl}` : ''),
signIn: (redirectTo?: string) => {
return `/sign-in${redirectTo ? `?redirectTo=${encodeURIComponent(redirectTo)}` : ''}`
},