Skip to content

Commit c1f1675

Browse files
Fix login if current location equal to target (#10436)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
1 parent f56a483 commit c1f1675

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/login-resources/src/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,21 @@ export async function doLoginNavigate (
10121012
}
10131013
}
10141014

1015+
const currentLoc = getCurrentLocation()
1016+
10151017
const loc = getCurrentLocation()
10161018
loc.path[1] = result.token != null ? 'selectWorkspace' : 'confirmationSend'
10171019
loc.path.length = 2
10181020
if (navigateUrl !== undefined) {
10191021
loc.query = { ...loc.query, navigateUrl }
10201022
}
10211023

1024+
// If we're already on the target page, reload to refresh state
1025+
if (loc.path.length === currentLoc.path.length && isSameSegments(currentLoc, loc, loc.path.length)) {
1026+
window.location.reload()
1027+
return
1028+
}
1029+
10221030
navigate(loc)
10231031
}
10241032
}

0 commit comments

Comments
 (0)